node-qunit-puppeteer icon indicating copy to clipboard operation
node-qunit-puppeteer copied to clipboard

npm install failed

Open djcooke opened this issue 6 years ago • 3 comments

I tried installing via sudo npm install -g node-qunit-puppeteer as suggested in the readme. It failed with the following error:

ERROR: Failed to download Chromium r641577! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-qunit-puppeteer/node_modules/puppeteer/.local-chromium'
  -- ASYNC --
    at BrowserFetcher.<anonymous> (/usr/lib/node_modules/node-qunit-puppeteer/node_modules/puppeteer/lib/helper.js:110:27)
    at Object.<anonymous> (/usr/lib/node_modules/node-qunit-puppeteer/node_modules/puppeteer/install.js:64:16)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:868:12)
    at internal/main/run_main_module.js:21:11
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path:
   '/usr/lib/node_modules/node-qunit-puppeteer/node_modules/puppeteer/.local-chromium' }

I was able to install via sudo npm install -g node-qunit-puppeteer --unsafe-perm=true --allow-root (similar to what was suggested here: https://github.com/GoogleChrome/puppeteer/issues/1597#issuecomment-396957020)

Ubuntu 16.04 node v11.13.0 npm 6.7.0

djcooke avatar Apr 11 '19 13:04 djcooke

Check access rights for /usr/lib/node_modules/. It seems that write access is allowed to root only:

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-qunit-puppeteer/node_modules/puppeteer/.local-chromium'

ameshkov avatar Apr 11 '19 13:04 ameshkov

That is correct - only root has write access. I usually use sudo to install node modules globally, and that is fine for most modules. It might be useful to note in the readme that the extra parameters may be necessary if installing as root

djcooke avatar Apr 11 '19 13:04 djcooke

sudo npm install -g node-qunit-puppeteer

sudo should never be used tbh.

DanielRuf avatar Feb 15 '20 17:02 DanielRuf