Permission denied when installing npm module
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
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.
It's best to change ownership to the directory to your username. $(whoami)