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:
change ownership
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
worked for as i installed package using sudo
Simply run on terminal : sudo chown -R $(whoami) ~/.npm
This worked for me !!
Restore ownership of the user's npm related folders, to the current user, like this:
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Simply do sudo npm cache clean --force --unsafe-perm
and npm i
will go normally.