admin管理员组

文章数量:1424377

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._pile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)

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._pile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
Share Improve this question asked May 4, 2016 at 15:27 FridoxFLFridoxFL 671 silver badge8 bronze badges 7
  • Order it as superuser, sudo bower install. – Tushar Commented May 4, 2016 at 15:28
  • 2 You should not have to run bower with sudo. You messed up when installing it. There's a folder's permission issue for sure. – yBrodsky Commented May 4, 2016 at 15:29
  • How I can fix that permissions issue? – FridoxFL Commented May 4, 2016 at 15:32
  • 1 @FridoxFL 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. – nem035 Commented May 4, 2016 at 15:40
  • 1 @nem Fixed with chown -r the .cache folder, thanks you very much! – FridoxFL Commented May 4, 2016 at 15:42
 |  Show 2 more ments

3 Answers 3

Reset to default 6

This mand 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

.

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

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.

本文标签: javascriptBower install EACCESS errorStack Overflow