you can try delete ALL the global yarn configuration files. open terminal: rm -f ~/.yarn*. then Run yarn set version stable or your specific version and run yarn install again
rm -f ~/.yarn*.
yarn set version stable
yarn install