Reputation: 11
I've tried in command "yarn global add @nestjs/cli"
but command return "zsh: command not found: yarn"
so I tried to install yarn "npm install -global yarn"
however, access denied
What should I do?
Upvotes: 1
Views: 1691
Reputation: 461
Simply do this!
sudo chown -R $USER /usr/local/lib/node_modules
sudo chown -R $USER /usr/local/bin
npm install -g yarn
Upvotes: 0
Reputation: 5941
First check who is the owner of the directory =>
ls -la /usr/local/lib/node_modules/yarn
then change owner to Yourself
sudo chown -R $USER /usr/local/lib/node_modules/yarn
Then try again, you shouldn't have any problems with this error.
npm install --global yarn
you may need to use sudo
before npm
sudo npm install --global yarn
Upvotes: 1