I\'m getting a strange permission error when I try to install an npm module. I\'m starting it with sudo
so I\'m sure I do have access, but for some reason it ke
A rule of thumb as I have learned is to never run npm install
with sudo. That creates items with root
being the owner as opposed to your username.
Give full permission to node modules folder
command
sudo chmod 777 -R node_modules/
You need to reclaim ownership of the .npm directory.
sudo chown -R $(whoami) ~/.npm
and need the write permission in node_modules directory:
sudo chown -R $(whoami) /usr/lib/node_modules