sindresorhus/pageres

pageres-cli fails to install

php4fan opened this issue · 3 comments

Following installation instructions from https://github.com/sindresorhus/pageres-cli

npm install --global pageres-cli
npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN notice [SECURITY] puppeteer has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=puppeteer&version=5.5.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] lodash has the following vulnerabilities: 4 high, 2 low. Go here for more details: https://www.npmjs.com/advisories?search=lodash&version=3.10.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
/usr/local/bin/pageres -> /usr/local/lib/node_modules/pageres-cli/cli.js

> puppeteer@5.5.0 install /usr/local/lib/node_modules/pageres-cli/node_modules/puppeteer
> node install.js

ERROR: Failed to set up Chromium r818858! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
{ [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pageres-cli/node_modules/puppeteer/.local-chromium']
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path:
   '/usr/local/lib/node_modules/pageres-cli/node_modules/puppeteer/.local-chromium' }
npm WARN ws@7.5.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.5.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@5.5.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@5.5.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-06-18T12_02_12_267Z-debug.log

Note: the directory /usr/local/lib/node_modules/ does not exist.

J-F-M commented

I had the same issue, that's an issue with puppeteer. I solved it by not installing with sudo / as root but instead making sure my user had writing rights to /usr/local/lib/node_modules.

Me too at Ubuntu 20.04 as root.

This workaround

I solved it by not installing with sudo / as root but instead making sure my user had writing rights to /usr/local/lib/node_modules.

has helped me too.

Try the latest version: https://github.com/sindresorhus/pageres/releases/tag/v7.0.0 It may have resolved the issue.