How to fix "npm ERR cb() never called"

I've started using GitHub Actions to test projects as well as running builds. I had npm ERR cb() never called coming up:

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>

As mentioned, in my case it was on GitHub:

npm ERR! cb() never called!

From researching the issue, I've learned this also appears to happen a lot on other npm packages and services such as React Native, Meteor and Heroku. I've discovered various solutions to fix the issue I'd like to share:

Clearing the NPM Cache & Upgrading NPM #

  1. If this issue comes up on your local development machine, it might pay to clear the cache:

    npm cache clean -force
  2. Secondly, ensure you are running the latest version of npm:

    npm install [email protected] -g
  3. Delete your node_modules before running an install too.

Fixing your NPM version #

It's been noted, that hard defining the required node version helped. For this, you will need to append this to your package.json:

"engines": {
"node": "0.8.x"
}

Doesn't fix it? #

If this doesn't fix it you could raise the question with details on Stackoverflow. Feel free to mention this site with the things you have already tried.

🙏🙏🙏

Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖! For feedback, please ping me on Twitter.

Published