This is an error with npm itself (v6.9.0)

I tried installing dependencies for my project using npm i

What Happened Instead

I got an error which was :

npm i
Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ahmedisam99/.npm/_cacache/content-v2/sha512/fd/38'his/node

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ahmedisam99/.npm/_cacache/content-v2/sha512/bd/00'is/node_

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ahmedisam99/.npm/_cacache/content-v2/sha512/b7/73'what-is-

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ahmedisam99/.npm/_cacache/content-v2/sha512/bd/30'this/nod

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ahmedisam99/.npm/_logs/2019-04-02T06_30_36_618Z-debug.log

Reproduction Steps

You can update npm to the latest version (v6.9.0) using npm install -g npm@latest and then try installing dependencies

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.13.0',
  openssl: '1.1.1b',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.27.0',
  v8: '7.0.276.38-node.18',
  zlib: '1.2.11' }
$ node -p process.platform
linux

Hi @ahmedisam99! There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:


sudo chown -R $(whoami) ~/.npm

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.