EACCESS Error when doing npm install -g bower

喜欢而已 提交于 2019-12-02 18:48:33

问题


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

回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/25473281/eaccess-error-when-doing-npm-install-g-bower

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!