Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Global install: Permission denied in wd dependency #3248

Open reda-alaoui opened 6 years ago

reda-alaoui commented 6 years ago

On Ubuntu 17.10, I had a hard time installing web-component-tester globally.

[13:56:26] rhousni@rhousni:~/Downloads $ sudo npm install -g web-component-testernpm WARN deprecated @types/assert@0.0.29: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
npm WARN deprecated isarray@2.0.1: Just use Array.isArray directly
/usr/bin/rimraf -> /usr/lib/node_modules/rimraf/bin.js
/usr/bin/wct -> /usr/lib/node_modules/web-component-tester/bin/wct
/usr/bin/wct-st -> /usr/lib/node_modules/web-component-tester/bin/wct-st

> uws@9.14.0 install /usr/lib/node_modules/web-component-tester/node_modules/uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0

sh: 1: cannot create build_log.txt: Permission denied

> wd@1.6.1 install /usr/lib/node_modules/web-component-tester/node_modules/wd
> node scripts/build-browser-scripts

/opt/nodejs/node_modules/web-component-tester/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: EACCES: permission denied, mkdir '/opt/nodejs/node_modules/web-component-tester/node_modules/wd/build'
    at Object.fs.mkdirSync (fs.js:885:18)
    at sync (/opt/nodejs/node_modules/web-component-tester/node_modules/mkdirp/index.js:71:13)
    at Object.<anonymous> (/opt/nodejs/node_modules/web-component-tester/node_modules/wd/scripts/build-browser-scripts.js:6:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wd@1.6.1 install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wd@1.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It is caused by https://github.com/admc/wd/issues/483 and https://github.com/npm/npm/issues/17346.

The current workaround is to add --unsafe-perm argument.

$ sudo npm install -g web-component-tester --unsafe-perm
valyrie97 commented 5 years ago

this also happens on my fresh install of macos 10.14.1

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.