【原创】真·修复npm ERR! cb() never called!的错误

真实可行的修复npm ERR! cb() never called!


遇到这种奇怪的错误,找了很久,试错了很久。发现有以下可行方式

在运行npm install时报如下错误:


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:
npm ERR!     D:\node-v12.6.0-win-x64\node-cache\_logs\2020-12-03T05_58_18_180Z-debug.log

方式一


最简单的方法,删掉 package-lock.json 文件,重新执行 npm install。 如果还是不行,就删掉 package-lock.json + node_module 文件,重新执行npm install。

删除文件可使用 rimraf node_modules ,详情可看另一篇文章。

方式二


网络问题,严重怀疑是网络不稳定造成的,可改用淘宝镜像 cnpm,或者 yarn 去执行install。

方式三(普遍方式)


反正我试过没用…

1.以管理员模式打开cmd清除你的npm缓存 (mac电脑在npm前加sudo):

npm cache clean -f

2.清除完缓存后,安装最新版本的Node helper:

 npm install -g n

3.然后安装npm包管理助手

npm install -g n --force

4.用n助手安装最新的稳定版的node

n stable
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值