How to fix "npm ERR cb() never called" | Quick Fix


Here we will learn how to fix "npm ERR cb() never called" error in our nodejs application easily. This error is very common in any JavaScript frameworks and libraries like reactjs, vuejs too.

Reasons for the error

This error usually occurs

  1. When we install too many node modules packages in our project and due to which sometime our package-lock.json file gets corrupt.
  2. Or sometimes when updating our nodejs version to the latest one, it corrupts the package.json file.

Fixes for "npm ERR cb() never called" error.

To fix the npm err cd() error, i found this two solutions and it fixes my issue.

Solution 1: Clearing the NPM Cache & Upgrading NPM

First delete the package-lock.json file. And then clean the node cache by typing the following command:

npm cache clean --force

And then make sure you are running the latest version of npm:

npm install npm@latest -g

Solution 2: Delete and Install node_modules folder

Delete package-lock.json file and whole node_modules folder and then reinstall everything typing the command:

npm install

Note: Do not delete the package.json file or npm install wont work.

I hope the above two solution works for you too. 😀


💾 Recommended Articles