This was one extremely annoying error that we kept encountering when trying to update existing node packages using the Node Package Manager from the command line:
npm ERR! cb() never called!
After much googling (interrupted by intermittent bouts of swearing at the computer) we finally found a solution to the problem.
Delete and try again
Now there may have been a less drastic solution (such as changing ownership of the .npm directory for example - which is an approach we only thought of later on post-solution) but after trying the following:
npm cache clean
And finding not one single improvement in the situation we opted to simply remove the .npm folder from our home directory like so:
rm -rf ~/.npm
This was followed by downloading and re-installing the Node and Node Package Manager Mac OS X Installer universal binary available here.
Upon successful re-installation we then opened a new Terminal window and re-ran the following command:
npm update -g
To find the Node Package Manager updating previously installed packages on the system - which is exactly what we wanted to see happening.
Like we stated above, there may be a less drastic solution to resolving the ERR! cb() never called message but this is the one that we found worked for us.
If you know of any other methods, feel free to give us a heads up using the comment form below.
Comments
There are no comments