Alfa Dcz
Alfa Dcz

Reputation: 11

Install yarn denied

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

enter image description here

What should I do?

Upvotes: 1

Views: 1691

Answers (2)

Anandesh Sharma
Anandesh Sharma

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

MarioG8
MarioG8

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

Related Questions