EACCES Error with Bower install?

41,020

Solution 1

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

Solution 2

Change the ownership for the .config and cache directory

sudo chown -R username:username ~/.config 

and

sudo chown -R username:username ~/.cache

Solution 3

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.

Solution 4

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

Solution 5

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

Share:
41,020

Related videos on Youtube

Brad Adams
Author by

Brad Adams

👨‍💻 Frontend developer, working with technologies such as React, React-native & Vue.

Updated on August 19, 2020

Comments

  • Brad Adams
    Brad Adams almost 4 years

    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?

    • Brad Adams
      Brad Adams over 10 years
      ##MY-DOWNLOAD-CODE## is my download code I've hidden btw, just a heads up that's not the problem :)
    • JackNova
      JackNova about 9 years
      sudo chown -R breadadams /Users/breadadams/.cache/bower/packages/7480e059b318750565b4‌​b25c2556c9c4'
  • Vageesh Bhasin
    Vageesh Bhasin about 10 years
    Thanks, I was facing a similar problem while using Ember-CLI, where the installation stopped because bower failure to rename tmp directories. Did as you suggested, and everything worked fine. Thanks again :)
  • Edwin Dalorzo
    Edwin Dalorzo almost 10 years
    Alternatively the command bower cache clean will have the same effect irrespective of OS.
  • Christopher Marshall
    Christopher Marshall about 9 years
    bower cache clean was still throwing errors, had to cd to the cache folder and delete manually.
  • Tyler Davis
    Tyler Davis about 9 years
    I used yours but modified. sudo chown -R username ~/.config sudo chown -R username ~/.cache without the extra ":username" and mine worked. What is the purpose of the :username?
  • Liko
    Liko almost 9 years
    This is a good solution. Thanks. You can also use the user alias: sudo chown -R $USER ~/.config AND sudo chown -R $USER ~/.cache.
  • Zeel Shah
    Zeel Shah almost 9 years
    @TylerDavis it is specified like username:usergroup where usergroup may have many users. but by default there is not usergroup is created hence your command worked.
  • Ryan
    Ryan almost 9 years
    I had inadvertently installed bower and npm as root, and have not been able to run them without sudo/--allow-root for a long, long time. This fixed it for me, thank you very much.
  • rcat24
    rcat24 over 8 years
    @Tyler Davis you have saved my day!
  • Nick Brady
    Nick Brady over 8 years
    If this worked, then you have a permissions issue. Using the chown command as others have specified below will actually fix the error. You can navigate to /Users/<username>/.config/configstore and use "ls -l" to check ownership. If any of those files are owned by root, that is likely what is causing the issue. This is where you use "sudo chown -R .config/" (assuming you're in the same directory as the .config dir) to change the user ownership. Check similarly on the ~/.cache directory
  • MadPhysicist
    MadPhysicist almost 8 years
    I have tried everything above and only this fixed for me! Much appreciated! P.S. Why does this happen? My working project just broke suddenly. I have not made any changes ...
  • Eric Soyke
    Eric Soyke almost 8 years
    Same problem as Christopher, removing the directory was required for me. Strange as bower cache clean has worked for me in the past, but I've since updated a lot so maybe bower has changed in that respect.
  • aemonge
    aemonge almost 8 years
    After that command I suggest (as suggested below) to run: $ sudo chown YOUUSERNAME:staff ~/.config/configstore/bower-github.json ~/.config/configstore/update-notifier-bower.json
  • RyanCameron.Me
    RyanCameron.Me over 7 years
    I tried the first comment and my user owns the file and the group is staff. How do I fix this issue for the future?
  • PlunkettBoy
    PlunkettBoy over 6 years
    Changing the permissions as stated below is the proper fix for this I think.
  • russellhoff
    russellhoff over 4 years
    May be of help running also $sudo chown -R {user}:{group} ~/.cache.
  • russellhoff
    russellhoff over 4 years
    May be of help running also $sudo chown -R {user}:{group} ~/.cache.
  • Renat Gatin
    Renat Gatin over 4 years
    how it is different to what I wrote?
  • russellhoff
    russellhoff over 4 years
    Copy paste issue. I didn't mean .cache, I meant ~/.npm