EACCES Error with Bower install?

2020-02-16 11:49发布

I've read a few answers on StackOverflow & some other sites but none seem to fix the issue I'm having.

I'm installing AppGyver Add-ons, via terminal. Getting the following error:

BradMacBookPro:SparksInSpain breadadams$ bower install https://##MY-DOWNLOAD-CODE##@addons.appgyver.com/steroids-addons.js?version=3.1.0 --save
bower not-cached    https://##MY-DOWNLOAD-CODE##@addons.appgyver.com/steroids-addons.js?version=3.1.0#*
bower resolve       https://##MY-DOWNLOAD-CODE##@addons.appgyver.com/steroids-addons.js?version=3.1.0#*
bower download      https://##MY-DOWNLOAD-CODE##@addons.appgyver.com/steroids-addons.js?version=3.1.0
bower EACCES        EACCES, mkdir '/Users/breadadams/.cache/bower/packages/7480e059b318750565b4b25c2556c9c4'

Stack trace:
Error: EACCES, mkdir '/Users/breadadams/.cache/bower/packages/7480e059b318750565b4b25c2556c9c4'

Console trace:
Trace
    at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:74:17)
    at Logger.updateNotifier.packageName (/usr/local/lib/node_modules/bower/bin/bower:109:18)
    at Logger.EventEmitter.emit (events.js:95:17)
    at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
    at /usr/local/lib/node_modules/bower/lib/commands/install.js:27:16
    at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:808:24)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:834:30
    at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:752:41)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:574:44

System info:
Bower version: 1.2.8
Node version: 0.10.25
OS: Darwin 13.1.0 x64

I'm not sudo, I've tried --allow-root, cleaned the bower cache, always get the same error on install. Some local permission problem?

8条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-02-16 12:19

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
查看更多
我命由我不由天
3楼-- · 2020-02-16 12:21

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

查看更多
何必那么认真
4楼-- · 2020-02-16 12:23

Change the ownership for the .config and cache directory

sudo chown -R username:username ~/.config 

and

sudo chown -R username:username ~/.cache
查看更多
再贱就再见
5楼-- · 2020-02-16 12:24

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.

查看更多
爷、活的狠高调
6楼-- · 2020-02-16 12:24

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

查看更多
乱世女痞
7楼-- · 2020-02-16 12:26

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

查看更多
登录 后发表回答