Bower Installation Errors

时光毁灭记忆、已成空白 提交于 2019-12-03 09:20:32

You need root access or permissions to install globally! Try :

 sudo npm install -g bower
lrsjng

Much better than using sudo is setting a user level prefix. For example in ~/.npmrc set:

prefix = ${HOME}/npm-global

to use this folder for packages installed with -g.

Then you also need to set your PATH environment variable to include ${HOME}/npm-global/bin.

you shouldn't sudo bower right? I mean sudo npm install -g bower will work BUT here's the message I got:

Additional error details: Since bower is a user command, there is no need to execute it with superuser permissions. If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option


If you've installed node/npm via Homebrew on OSX you may want to first run brew doctor and follow instructions before sudo-ing any system folders. In my case this brought up a nag about agreeing to an Xcode/iOS license:

Builds will fail! Agree to the license by opening Xcode.app or running: xcodebuild -license

After doing that and running a brew update I was able to install Bower globally as expected.

Kasia B M

I know that it's an old thread but I run into the issue recently after reinstalling Yosemite and xCode tools. In case anyone else gets stuck, what helped me was using the commands:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

Following suggestion from the thread below: https://github.com/bower/bower/issues/2262

sfotiadis

Using sudo with npm is discouraged.

Look here https://stackoverflow.com/a/18277225/1857521 for a better solution to an almost identical problem.

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