I have managed to corrupt my npm
install, and whenever I try to install packages using npm install
, I receive error messages along these lines:
you can try following command for expo :
sudo chown -R $USER:$GROUP ~/.expo
This one works for me:
sudo chown -R $(whoami) ~/.npm
I did not use the -g
because I am the only user. I used a MacBook Air.
Above answer didn't work for me. Just try to run your command with --unsafe-perm
.
e.g
npm install -g node@latest --unsafe-perm
This seems to solve the problem.
This worked for me!
Resolving EACCES permissions errors when installing packages globally
sudo npm cache clean --force --unsafe-perm
and then npm i goes normally
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) ~/.config