npm ERR! cb() never called! npm ERR! This is an error with npm itself.错误解决办法

最近接手了一个前台项目,执行npm install的时候一直报错:

npm ERR! cb() never called! 
npm ERR! This is an error with npm itself. 

这个问题困扰了我几天,网上答案五花八门,不过对我来说,那些方法都没有效果,记录一下我解决这个错误的步骤,如下:
1.删除下载好的node_modules   rimraf node_modules

npm install rimraf -g       
rimraf node_modules

2.删除package-lock.json文件
管理员权限执行下面的命令:

3.清除npm缓存

npm cache clean --force


4.npm install
大功告成!

如果这篇文章对您有帮助,您可以打赏我

技术交流QQ群:15129679

原文地址:https://www.cnblogs.com/yeminglong/p/15099954.html