EACCES Error with Bower install?

我的未来我决定 提交于 2019-11-29 20:51:19
JoelPrz

I had a similar issue that I couldn't resolve using these suggestions. I was successful when I ran Bower with root privileges, like so:

sudo bower install --allow-root

Change the ownership for the .config and cache directory

sudo chown -R username:username ~/.config 

and

sudo chown -R username:username ~/.cache

I noticed you tried this from a MacBook Pro.

You could try this:

  • go to the finder
  • under menu go Go To Folder type this: ~/.cache/bower
  • delete its content and try again.

Also as @Edwin suggested you may try:

The command bower cache clean which will have the same effect irrespective of OS.

CodeGuyRoss

Im not sure what happened with my project but in order to fix the issues with bower I had to run the following.

sudo npm install -g bower

sudo bower cache clean --allow-root 

rm -Rf bower_components

sudo bower install --allow-root

Im still not really sure what went wrong but after those commands i was up and running

I hit the same thing and noticed that the bower_components folder was owned by the root user. I changed ownership to my user and everything worked without having to run bower as root.

sudo chown -R $USER bower_components

1) run

$groups

to get the name of your group

2) then run

$sudo chown -R {user}:{group} ~/.config 
$sudo chown -R {user}:{group} ~/.cache

where {user} - is username and {group} - is group name

Like everyone says, bower and npm shouldn't be run with sudo. This corrected the problem for me on my OSX machine.

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

Now you should be able to run:

npm install
npm start 

and even

bower install

without having to use sudo.

*note npm start usually calls bower install

I had the same issue but nothing above worked for me. If you recently updated Xcode and don't recognize, don't forget to agree the terms and install the command line tools!

xcode-select --install

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