Bower install EACCESS error
Asked Answered
C

3

2

Im getting this error trying to install dependencies from bower.json (bower install) and i don't know what is it or how i can fix it... any help would be apreciated.

 ✘ deniz946@UbuntuOS  ~/Desktop/meanapp/client   resourcejs  bower install
/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
                throw err;
                ^

Error: EACCES: permission denied, open '/home/deniz946/.config/configstore/bower-github.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at Object.create.all.get (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
    at Object.Configstore (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:28:44)
    at readCachedConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:19:23)
    at defaultConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:11:12)
    at Object.<anonymous> (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/index.js:16:32)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
Coalfish answered 4/5, 2016 at 15:27 Comment(7)
Order it as superuser, sudo bower install.Theatre
You should not have to run bower with sudo. You messed up when installing it. There's a folder's permission issue for sure.Whyalla
How I can fix that permissions issue?Coalfish
@Coalfish sudo chown <yourusername> <pathtothefilewithwrongpermissions>Papain
@nem i've did that and now im getting this error pastebin.com/yaZQy8d7Coalfish
@Coalfish you are getting a permissions issue again. Most likely your permissions problem is somewhere higher up, you might need to recursively chown the .cache folder as well but perhaps more research on this issue might show you a better way to solve this. Usually these problems arise when you install npm or bower with sudo when it doesn't need it and then anything they use will require sudo permissions as well.Papain
@nem Fixed with chown -r the .cache folder, thanks you very much!Coalfish
R
6

This command should work . It provide permission to bower configration.

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

and also give permission to folder by

sudo chmod -R 777 foldername

.

Repeater answered 12/9, 2016 at 5:27 Comment(0)
S
1

You are facing access permissions error. Use sudo:

sudo bower install

EDIT: sudo does not seem to be working with bower install. This works for me though:

bower install --allow-root
Synchronize answered 4/5, 2016 at 15:30 Comment(5)
When I use sudo, I get another kind of error "sudo bower install" >>/usr/bin/env: node: No such file or directoryCoalfish
Bower usually requires the --allow-root flagPapain
The node binary may not be on your $PATH. try symlinking it like so "ln -s /usr/bin/nodejs /usr/bin/node"Synchronize
@Mike Just did it but still not working, getting this error pastebin.com/yaZQy8d7Coalfish
This will not work in NPM versions > 6. See my answer for why.Prism
P
1

For a more exotic take, where you are running as root in Docker and experiencing this, one should know that NPM is running as the owner of the current working directory. So in case you are root and does not work no matter what you try, try listing the files and see if they are owned by root. If not, it will never work, unless you change the ownership to root.

See this answer for the full explanation and references to source code in NPM.

Prism answered 10/12, 2021 at 0:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.