(Beginner) Can't install yarn

I’m following the official ruby on rails installation guide. I’m directed to install yarn but when I run ‘corepack enable’ I receive the following error:

Internal Error : EACCES: permission denied, symlink ‘…/lib/node_modules/corepack/dist/pnpm.js’ → '/usr/local/bin/pnpm’

Error: EACCES: permission denied, symlink ‘…/lib/node_modules/corepack/dist/pnpm.js’ → '/usr/local/bin/pnpm’

I’ve tried googling the error but still couldn’t make sense of what I’m suppose to do. Was hoping someone here could help out a noob lol. Thank you!

try to use sudo ? Maybe your nodejs is not installed correctly,try to reinstall your nodejs

1 Like

Thank you - sudo worked for me!

I think you have bigger problems than yarn if you’re getting permissions issues when installing yarn. Are you using nvm to install node? – H

2 Likes