polymer-starter-kit icon indicating copy to clipboard operation
polymer-starter-kit copied to clipboard

sudo npm run deps: -> Error: EACCES, permission denied....

Open vl4dt opened this issue 11 years ago • 15 comments

Error: EACCES, permission denied '/root/.config/configstore/bower-github.yml' You don't have access to this file.

at Object.fs.openSync (evalmachine.<anonymous>:438:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:289:15)
at Object.create.all.get (/home/ricardo/dev/liu-bob-psk/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/home/ricardo/dev/liu-bob-psk/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/home/ricardo/dev/liu-bob-psk/node_modules/web-component-tester/node_modules/bower/lib/config.js:22:23)
at defaultConfig (/home/ricardo/dev/liu-bob-psk/node_modules/web-component-tester/node_modules/bower/lib/config.js:11:24)
at Object.<anonymous> (/home/ricardo/dev/liu-bob-psk/node_modules/web-component-tester/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

npm ERR! [email protected] postinstall: node scripts/postinstall.js npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is most likely a problem with the web-component-tester package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node scripts/postinstall.js npm ERR! You can get their info via: npm ERR! npm owner ls web-component-tester npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.16.7-21-desktop npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! cwd /home/ricardo/dev/liu-bob-psk npm ERR! node -v v0.10.31 npm ERR! npm -v 1.4.23 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/ricardo/dev/liu-bob-psk/npm-debug.log npm ERR! not ok code 0

npm ERR! [email protected] deps: npm install -g gulp && npm install -g bower && npm install && bower install npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] deps script. npm ERR! This is most likely a problem with the polymer-starter-kit package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm install -g gulp && npm install -g bower && npm install && bower install npm ERR! You can get their info via: npm ERR! npm owner ls polymer-starter-kit npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.16.7-21-desktop npm ERR! command "/usr/bin/node" "/usr/bin/npm" "run" "deps" npm ERR! cwd /home/ricardo/dev/liu-bob-psk npm ERR! node -v v0.10.31 npm ERR! npm -v 1.4.23 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/ricardo/dev/liu-bob-psk/npm-debug.log npm ERR! not ok code 0

vl4dt avatar May 29 '15 20:05 vl4dt

I managed to get around this by just running the commands defined in the package.json myself:

sudo npm install -g gulp
sudo npm install -g bower
sudo npm install
bower install

kaestlyn avatar May 29 '15 20:05 kaestlyn

Still fails here on my machine: Error: EACCES, permission denied '/root/.config/configstore/bower-github.yml'

Same file as before

vl4dt avatar May 29 '15 20:05 vl4dt

@vl4dt were you able to work around this using the commands directly? I would suggest checking if permissions are setup correctly too: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Btw, for anyone getting stuck with the tooling version of PSK, there's also a non-tooling version available: https://github.com/PolymerElements/polymer-starter-kit/releases

addyosmani avatar May 29 '15 21:05 addyosmani

Another option. Try sudo chown -R [user name] ~/.config and sudo chown -R [user name] ~/.cache

addyosmani avatar May 29 '15 21:05 addyosmani

Success!

@addyosmani I tried running the command manually as @Kaestlyn suggested, at some point one of them failed at the same point.

After all the problem was permissions were not setup correctly, followed what you suggested: https://docs.npmjs.com/getting-started/fixing-npm-permissions, chose to change npm's default directory permissions, ran:

$ npm run deps
$ gulp test:local
$ gulp
$ gulp serve

All successful, no warnings or errors, thanks a lot both!

vl4dt avatar May 29 '15 22:05 vl4dt

Fantastic. Thanks!

addyosmani avatar May 30 '15 00:05 addyosmani

Still getting the EACCESS errors even after fixing npm permissions, but then running each command separately as suggested by @Kaestlyn seems to work for me.

kbwatts avatar May 30 '15 00:05 kbwatts

This worked for me:

sudo bower install --allow-root

omarjebari avatar Sep 14 '15 12:09 omarjebari

Thank you @vl4dt I've indeed followed what you've done.

$ sudo chown -R my_user_name /usr/local/lib/node_modules $ sudo chown -R my_user_name /usr/local/bin $ sudo chown -R my_user_name /usr/local/share $ npm install gulp-cli --global

It worked :)

cjpillette avatar Oct 21 '16 06:10 cjpillette

Just to be clear, when I do this on my linux box wearing my admin hat, I operate as root, so why would my userid not be able to have read access to any of the installation dirs?

sc6l6d3v avatar Jan 31 '17 21:01 sc6l6d3v

@rictic have you seen this issue with web-component-tester before?

On Tue, Jan 31, 2017, 1:20 PM nanothermite [email protected] wrote:

Just to be clear, when I do this on my linux box wearing my admin hat, I operate as root, so why would my userid not be able to have read access to any of the installation dirs?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PolymerElements/polymer-starter-kit/issues/54#issuecomment-276496043, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBFDTnS93brRj6kmGZN-zn0QKQ3-XVMks5rX6WRgaJpZM4EvrLe .

robdodson avatar Jan 31 '17 23:01 robdodson

I haven't, that's strange. Where does wct use bower?

@azakus have you heard of such?

rictic avatar Feb 10 '17 04:02 rictic

@addyosmani solution worked for me. Here goes a slightly modified version not requiring you to fill in your username:

sudo chown -R $USER ~/.config
sudo chown -R $USER ~/.cache

RicardoBarroso avatar Sep 25 '17 23:09 RicardoBarroso

for me i refresh the font (the folder which is complaining ) folder permissions then restart the terminal and it works

hayat12 avatar Nov 09 '17 17:11 hayat12

what also causes this error is due to incorrect path

Jayprecode avatar Jul 26 '21 11:07 Jayprecode