运行环境:nvm安装的node最新版14.15.4,npm的版本为6.14.10
cmd中执行npm install -g @vue/cli,期间电脑基本不能干其他事情,偶尔卡死,命令行经常假死,但实际还在运作,四五个小时之后,
错误代码如下:
22425 timing npm Completed in 5078502ms
22426 error cb() never called!
22427 error This is an error with npm itself. Please report this error at:
22428 error https://npm.community
尝试方法如下:

  • npm cache clean --force(同样命令行会假死,几分钟到几个小时不等)
  • 重新安装nvm,node和npm(其实根本没必要)

以上方法试过五六次,耗时近三天,没有用
然后尝试将npm源设置为国外的npm,并设置代理
,经过近4个小时的等待,终于安装成功了!
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules@vue\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN @vue/compiler-sfc@3.0.5 requires a peer of vue@3.0.5 but none is installed. You must install peer dependencies yourself.

+@vue/cli@4.5.10
added 1369 packages from 707 contributors in 12902.06s

Logo

前往低代码交流专区

更多推荐