tools: Permission denied for bower-github.yml

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! web-component-tester@3.1.3 postinstall: `node scripts/postinstall.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the web-component-tester@3.1.3 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

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 42 (3 by maintainers)

Commits related to this issue

Most upvoted comments

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

Looks like it needs group rw permission:

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

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