0

I am trying to install bull-repl package on my Ubuntu 20.4 system via

sudo npm i bull-repl -g

But I keep getting following error:

> node-jq@1.11.2 postinstall /usr/lib/node_modules/bull-repl/node_modules/node-jq
> npm run install-binary

npm ERR! code EACCES
npm ERR! syscall scandir
npm ERR! path /root/.npm/_logs
npm ERR! errno -13
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 65534:1000 "/root/.npm"
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}
...

I tried to clean the npm cache and some other stuff that was mentioned in another post about similar problem. And oc I tried solution from the message :)

Torsten Barthel
  • 3,059
  • 1
  • 26
  • 22

1 Answers1

0

you have a permission issue to write into /root/.npm. i strongly suggest that you will not run npm as root user but on behalf of another user.

i am sure it will solve your problem.

otherwise, grant the relevant permission on /root/.npm

Mr.
  • 9,429
  • 13
  • 58
  • 82