Tools: Permission denied for bower-github.yml

Created on 14 May 2015  路  42Comments  路  Source: Polymer/tools

Error is thrown when I try to install using npm with sudo.

sudo npm install -g web-component-tester

The error log:

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

    at Object.fs.openSync (evalmachine.<anonymous>:432:18)
    at Object.fs.readFileSync (evalmachine.<anonymous>:286:15)
    at Object.create.all.get (/usr/lib/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:34:29)
    at Object.Configstore (/usr/lib/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:27:44)
    at readCachedConfig (/usr/lib/node_modules/web-component-tester/node_modules/bower/lib/config.js:22:23)
    at defaultConfig (/usr/lib/node_modules/web-component-tester/node_modules/bower/lib/config.js:11:24)
    at Object.<anonymous> (/usr/lib/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! Linux 3.13.0-52-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "web-component-tester"
npm ERR! node v0.10.25
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

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 'node scripts/postinstall.js'.
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! Please include the following file with any support request:
npm ERR!     /home/localaccess/Desktop/Polymer/development/seed-element/npm-debug.log

I ran the following command line

sudo chown -R localaccess /home/localaccess/.config/configstore/

then check for permission. This is the result (notice, there is no bower-github.yml):

localaccess@administrator-Precision-T3610:~/Desktop/Polymer/development/seed-element$ ls -l /home/localaccess/.config/configstore
total 28
-rw------- 1 localaccess localaccess 37 May 13 15:50 insight-bower.yml
-rw-rw-r-- 1 localaccess localaccess 38 Feb 19 17:17 insight-yo.yml
-rw------- 1 localaccess localaccess 45 May 13 15:50 update-notifier-bower.yml
-rw------- 1 localaccess localaccess 45 Feb 19 17:17 update-notifier-generator-chromeapp.yml
-rw------- 1 localaccess localaccess 45 Feb 19 17:17 update-notifier-generator-mocha.yml
-rw------- 1 localaccess localaccess 45 Mar  2 11:29 update-notifier-web-component-tester.yml
-rw------- 1 localaccess localaccess 45 Feb 19 17:17 update-notifier-yo.yml
web-component-tester

Most helpful comment

I had luck doing:
sudo chown -R [username] ~/.cache/bower/
sudo chown -R [username] ~/.config/configstore/

All 42 comments

I have the same problem.

Actually, turned out those are permission problems root v. $user. I ended up installing wct locally.

@rbjarnason How did you install wct locally ? Sorry I'm not that of an expert on command line for Linux.

Same issue on Debian Jessie

:+1:

@rbjarnason to install locally: npm install web-component-tester

And then just run node_modules/web-component-tester/bin/wct

Same issue on Debian Stretch

Like @timeu said to me, you can try to delete the /home/$USER/.npm folder and npm install web-component-tester.
It works for me !

Looks like it needs group rw permission:

chmod g+rw ~/.config/configstore/bower-github.yml

_bump_

Same problem on OS X Yosemite. I guess I'll have to install it locally and add an environment variable for now.

Thanks crhym3 !

chmod g+rw ~/.config/configstore/bower-github.yml

fix problem for me.

thanks crhym3

Neither
chmod g+rw ~/.config/configstore/bower-github.yml
or
sudo chmod g+rw ~/.config/configstore/bower-github.yml
resolved the issue for me.

Same as @JayHoltslander. Giving group rw permissions didn't help.

I had luck doing:
sudo chown -R [username] ~/.cache/bower/
sudo chown -R [username] ~/.config/configstore/

Thanks @nhatbui. But still no luck :disappointed:

@gazal-k Someone suggested to me that I'd messed up my home folder's permissions earlier and I'd have to repair them while booted off the recovery partition. I haven't done this yet myself to see if it solves my issue but you might want to look into it.

@nhatbui sudo chown -R [username] ~/.config/configstore/ works for me. But I am not working with this 'Polymer/web-component-tester' package though...

@nhatbui Thanks, this fixed my issue also

Thanks crhym3

Hi,
the problem still occurs, when trying to install the package globally with sudo npm install-g web-component-tester. Changing the permissions as described above just fixes the issue for local (user-based) installation with npm install web-component-tester.

/usr/bin/wct-st -> /usr/lib/node_modules/web-component-tester/bin/wct-st

> [email protected] postinstall /usr/lib/node_modules/web-component-tester
> node scripts/postinstall.js


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

    at Object.fs.openSync (evalmachine.<anonymous>:439:18)
    at Object.fs.readFileSync (evalmachine.<anonymous>:290:15)
    at Object.create.all.get (/usr/lib/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:34:29)
    at Object.Configstore (/usr/lib/node_modules/web-component-tester/node_modules/bower/node_modules/configstore/index.js:27:44)
    at readCachedConfig (/usr/lib/node_modules/web-component-tester/node_modules/bower/lib/config.js:30:23)
    at defaultConfig (/usr/lib/node_modules/web-component-tester/node_modules/bower/lib/config.js:19:24)
    at Object.<anonymous> (/usr/lib/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.13.0-62-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "web-component-tester"
npm ERR! cwd /home/tkuchs
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
$ npm owner ls web-component-tester
nevir <[email protected]>
polymer <[email protected]>
azakus <[email protected]>

This is a duplicate of bower/bower#1607. This file, and a few others, are used by bower when installing.

I can try to make the bower install portion of wct use temporary file locations.

The best scenario would be to not use sudo when installing. There's a whole class of issues that go away when you only install as your local user.

@nhatbui Thanks, it works. ^_^

sudo chmod g+rw ~/.config/configstore/bower-github.yml resolved the problem for me...

Avoiding sudo has been the best course of action for me. Follow the directions here for great victory: https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-2-change-npm-s-default-directory-to-another-directory

@anthonykoerber that helped. Thanks :+1:

@nhatbui Thanks

I got luck doing:
chmod g+rw ~/.config/configstore/bower-github.yml

Run sudo chown -Rwhoami/Users/[username]/.config/configstore on OSX

@nhatbui chown worked for me

Thanks, @nhatbui worked for me too

Solid call - Thank you infinitely @Nhatbui.

sudo chown -R [username] ~/.cache/bower/
sudo chown -R [username] ~/.config/configstore/
@nhatbui 3Q so much!

this sudo chown -R [username] ~/.config/configstore/ worked for me on Ubuntu 14.04.3 LTS

Thanks @nhatbui - worked for me!

Thanks, @ErikSaunier - Worked for me!

@kel-dev thanks, work for me.

@sulhome Thanks, it works!

sudo chown -R [username] ~/.config/configstore/ worked for me as well.

Thanks @nhatbui, got my fix.

I was annoyed so gave it all permissions:
sudo chmod 777 ~/.config/configstore/bower-github.yml
Thus it worked!!

thanks @nhatbui

Was this page helpful?
0 / 5 - 0 ratings