Fix NPM Permissions Errors And Stop Using Sudo!

By December 10, 2015Blog, CLI, Node.js, Workflow
Allure Web Solutions Code Snippet

If you are always getting permissions errors when running the npm command, it’s likely that your user account doesn’t have ownership of the npm folder. Fix that quickly with the below command and never have to write sudo npm again!

sudo chown -R `whoami` ~/.npm

Most likely the .npm directory is in your User root, but if it isn’t, just replaced ~/.npm with the true location of your npm install.

Mike Doubintchik

Author Mike Doubintchik

More posts by Mike Doubintchik

Leave a Reply