npm-platform-dependencies icon indicating copy to clipboard operation
npm-platform-dependencies copied to clipboard

Node installed system-wide. sudo npm -g i <pacakge> fails with EACCES

Open corporateanon opened this issue 7 years ago • 1 comments

Node was installed like this:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Then i tried to install a package ([email protected]) which contains a platform dependency platform-folders managed with npm-platform-dependencies and got the following error.

Reproduced on 3 machines with Ubuntu, Gentoo and Debian.

Installing dependencies for linux
npm ERR! path /root/.npm/_logs
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall scandir
npm ERR! Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!  { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!   stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'scandir',
npm ERR!   path: '/root/.npm/_logs' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
glob error { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
  stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs' }
npm ERR! path /root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb'
npm ERR!  { Error: EACCES: permission denied, open '/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, open '/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'open',
npm ERR!      path: '/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb' },
npm ERR!   isOperational: true,
npm ERR!   stack: 'Error: EACCES: permission denied, open \'/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/root/.npm/_cacache/index-v5/72/cd/db7e56b5f30d99ee562b982f36baebabea27a061739c4bc1b5c327f3f7fb' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

corporateanon avatar May 26 '18 10:05 corporateanon

Hi, I am afraid I don't have much time to look or fix this, but if anyone fancy open a PR and I'll review it 👍

bortexz avatar Jun 15 '18 09:06 bortexz