npm install, got error:
npm ERR! cb() never called! npm ERR! This is an error with npm itself. Please report this error at: ...
I tried this problem for several days and found a lot of methods, but they were all unsuccessful. Finally, I combined many methods to solve it.
Record my solution here, so that you can solve this problem in the future:
I found a lot of methods for this problem on the Internet, and then I tried it. Then, in my opinion, my npm version may be too low, or when downloading dependencies, the Internet speed is too slow and it has been stuck, and finally an error is reported. These are just what I think
package.lock.jsonfile, it also needs to be deleted, if there is no such file, don’t delete it.
npm install npm -g
The following command lines are executed here at the same time (or not executed):
npm install -g webpack
4. Clear the cache and execute the command in the terminal window of the project
npm cache clean --force
The results are as follows:
5. Re-download dependencies,
Excuting an order:
If this command fails, repeat the above steps, and then use cnpm to install
npm install cnpm -g
Then execute cnpm to download the dependencies:
Although there are some red flags here, there is no error, it is okay, and the project can be started later
npm run dev