npm install failed
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
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'
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
sudo npm install -g node-qunit-puppeteer
sudo should never be used tbh.