“Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules'” DON’T SUDO!!!!

Please understand what you are doing when you use sudo. sudo is the superuser. So if you install something with sudo, sudo is now the owner of what was installed. The much better approach is to change ownership of the installation path to your username.

#For node modules
sudo chown -R username /usr/local/lib/node_modules

#So npm can add softlinks to path
sudo chown -R username /usr/local/bin

https://pawelgrzybek.com/fix-priviliges-and-never-again-use-sudo-with-npm/

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami