FridoxFL
FridoxFL

Reputation: 67

Bower install EACCESS error

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)

Upvotes: 2

Views: 1908

Answers (3)

oligofren
oligofren

Reputation: 22923

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.

Upvotes: 1

Mohit Bhardwaj
Mohit Bhardwaj

Reputation: 10083

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

Upvotes: 1

Himanshu sharma
Himanshu sharma

Reputation: 7901

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

.

Upvotes: 6

Related Questions