npm Community Forum (Archive)

The npm community forum has been discontinued.

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

cb() never called! error

I tried “npm install” in my project folder and its throwing me error as “Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/swathi/.npm/_cacache/tmp’”

Please let me know what to be done…Here is the complete error:
Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/swathi/.npm/_cacache/tmp’
npm ERR! cb() never called!

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

npm --versions 6.8.0 node -p process.platform

The “cb() never called!” is not the underlying error, it is usually a symptom of something else going wrong, in this case the EACCES: permission denied.

Do you use sudo when doing global installs?

The short version is try quick fix with:

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.