The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
error cb() never called! on macOs Mojave
What I Wanted to Do
install a npm package via terminal and command : npm i @nicky-lenaers/ngx-scroll-to --save
What Happened Instead
Unhandled rejection Error: EACCES: permission denied, mkdir ‘/Users/mbagiella/.npm/_cacache/index-v5/f1/82’
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! /Users/mbagiella/.npm/_logs/2019-04-29T16_06_22_881Z-debug.log
same function is working when using sudo
MacBook-Air:morefont mbagiella$ sudo npm i @nicky-lenaers/ngx-scroll-to --save
npm WARN firstname.lastname@example.org requires a peer of email@example.com - 3 but none is installed. You must install peer dependencies yourself.
npm WARN firstname.lastname@example.org requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
added 1 package from 2 contributors and audited 44743 packages in 6.65s
2019-04-29T16_06_22_881Z-debug.log (119,1 Ko)
node -p process.platform
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.
We also experience this issue on Windows (at least in travis-ci tests using Windows), and no we also are not doing global installs!
A fix would be realy great!
The “error cb() never called” is a generic error, and the underlying cause for permission errors is likely to be different on Windows and non-Windows.
Both of your links are for Ubuntu builds though. And do show EACCES errors.
CI builds are interesting because they are isolated and reproducible. There are a lot of reported “error cb()” and “EACCES” topics and your info is likely to be lost in the noise adding it to this report.
If you are interested, I suggest you open (yet another) new topic since since you have some interesting reproduction logs available. (I suggest mention Travis or CI in the title, like “Travis build fails with EACCES error in ~/.npm running npm install”.)