npm安装依赖报错: cb never called, cb never called

用npm安装依赖报错:

npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>
npm ERR! A complete log of this run can be found in:

这种报错一般都是因为各种情况下载node_moudules失败后,自己又去执行npm indtall 导致的。解决方案如下,依次执行。

解决办法:

零、删除下载失败的node_modules

删除掉下载失败的node_modules重新执行:npm install

一、清除npm缓存

npm cache clean -force

然后再次安装(npm install)

二、升级node版本

可以直接去node官网下载最新版本,也可以使用node包管理器 n

(记得删除已经安装的node_modules文件夹)

三、删除代理

删除已经安装一部分的node_modules文件夹,执行下面命令行:

npm config rm proxy
npm config rm https-proxy
1
2
然后再次安装(npm install)

猜你喜欢

转载自blog.csdn.net/weixin_43131046/article/details/124457983
今日推荐