Node modules won't install on Raspberry Pi

0

I keep getting the errors below when trying to install node modules on my Raspberry Pi 3 running Raspbian:

pi@raspberrypi:~ $ sudo npm install -g pageres-cli
/usr/bin/pageres -> /usr/lib/node_modules/pageres-cli/cli.js
puppeteer@1.15.0 install /usr/lib/node_modules/pageres-cli/node_modules/puppeteer
 node install.js
ERROR: Failed to download Chromium r650583! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/pageres-cli/node_modules/puppeteer/.local-chromium'
  -- ASYNC --
    at BrowserFetcher.<anonymous> (/usr/lib/node_modules/pageres-cli/node_modules/puppeteer/lib/helper.js:110:27)
    at Object.<anonymous> (/usr/lib/node_modules/pageres-cli/node_modules/puppeteer/install.js:64:16)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/lib/node_modules/pageres-cli/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.15.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@1.15.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/2019-05-02T08_26_30_046Z-debug.log

I have reinstalled nodejs/npm and run chmod 777 /usr/lib/node_modules/ as well as force cleaned the npm cache and even created the folders manually all the way to .local-chromium. I can't figure out if the problem is related to rights, a bad cache or something else.

KMBN

Posted 2019-05-02T08:44:01.387

Reputation: 1

No answers