This is an error with npm itself.

What I Wanted to Do

I was trying to install dependencies to my new project with this command:
npm i express ejs mysql body-parser --save

What Happened Instead

And I get this
Unhandled rejection Error: EACCES: permission denied, open ‘/home/sinpatrones/.npm/_cacache/tmp/1f355d98’

Unhandled rejection Error: EACCES: permission denied, open ‘/home/sinpatrones/.npm/_cacache/tmp/3ee1cd8a’

Unhandled rejection Error: EACCES: permission denied, open ‘/home/sinpatrones/.npm/_cacache/tmp/c471e0be’

Unhandled rejection Error: EACCES: permission denied, open ‘/home/sinpatrones/.npm/_cacache/tmp/e1f3ae81’

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/sinpatrones/.npm/_logs/2019-04-02T04_47_44_090Z-debug.log

Reproduction Steps

Details

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.3',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.51',
  zlib: '1.2.11' }

$ node -p process.platform
linux

Hi @SinPatrones! 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.

1 Like

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