These three steps worked for me to remove the constant npm EACCESS errors I was recieving.
- Reclaim ownership of the
.npmdirectory - Add need write permissions for the
node_modulesdirectory - Finally sort the ownership of the npm
bintoo
From the terminal use the following commands to achieve the above"
$ sudo chown -R `whoami` ~/.npm$ sudo chown -R `whoami` /usr/local/lib/node_modules$ chown -R `whoami` `npm -g bin`
Lately, I'e run into a few additional errors that can be resolved similarly. These obviously affect the npm config and cache permissions.
$ sudo chown -R `whoami` ~/.config$ sudo chown -R `whoami` ~/.cache