EACCESS Error when doing npm install -g bower

2019-03-06 07:11发布

When i run a command with -g (global) installation i get EACCESS errors . I read on one of the stack overflow answers that i should use 'sudo chown -R whoami ~/.npm' to run as local/root adminstrator but it didnt help

npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/.node/lib/node_modules/bower/.editorconfig' 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/Documents/tutorials/bookingappdemo
npm ERR! node -v v0.10.29
npm ERR! npm -v 2.0.0-alpha-5
npm ERR! path /Users/.node/lib/node_modules/bower/.editorconfig
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/Users/.node/lib/node_modules/bower/.editorconfig'
npm ERR! Additional logging details can be found in:
npm ERR! not ok code 0

2条回答
我命由我不由天
2楼-- · 2019-03-06 07:47

If you are an administrator I suggest you run the command as root: sudo npm install -g bower

查看更多
放我归山
3楼-- · 2019-03-06 07:54
I used --unsafe-perm with install e.g  
sudo npm install -g learnyounode --unsafe-perm

this helped me install without permissions error, hope this is fixed soon.

查看更多
登录 后发表回答