npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm install and results in an error

What I Wanted to Do

Tried installing and locally

What Happened Instead

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <>

Reproduction Steps

npm install

(Moved to #support)

Hi @harusunbear! The “cb() never called!” is not the underlying error, and hopefully there is another error visible in the console or in the log. There were some issues that were fixed in npm 6.6.0 to make sure all the errors get displayed, so if you have an older version then first step is to update.

Unhandled rejection Error: EACCES: permission denied, open '/home/brandon/.npm/_cacache/index-v5/11/d7/9a389bd7520ad1bcdc6a2a050876d7783dc3ec357143c6c6c7c8df92bd82'

This is what was displayed directly before the npm ERR! entries in the terminal

Running with superuser perms works fine, but of course that’s far from desirable.


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.

Seems that was the issue.

I removed with sudo, ran the chown snippet you posted, then installed again without sudo and there were no issues.

Strange how this sort of thing didn’t happen when installing other modules.