npm 安装错误 - cb() 从未调用过 [英] npm install error - cb() never called

查看:67
本文介绍了npm 安装错误 - cb() 从未调用过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我下载的 angular 项目中安装 node_module,但出现此错误:

I try to install node_module in my angular project what I downloaded, but I get this error:

npm 错误!注册表解析json错误

npm ERR! registry error parsing json

然后我使用 npm intall npm -g 重新安装 npm,然后当我尝试使用 npm install 后,我收到此错误:

Then i reinstall npm using npm intall npm -g and after when i try use npm install I get this error:

(node:11252) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): Error: ENOENT: no such file or directory, stat
'C:\Users\User\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-ec5da46c\angular\cdk.es5.js'

调试日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install' ]
2 info using npm@5.4.2
3 info using node@v6.10.2
4 verbose npm-session ff5ce249dfe37f0e
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall spa@0.0.0
7 info lifecycle spa@0.0.0~preinstall: spa@0.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 info lifecycle @angular/cdk@2.0.0-beta.10-a7ce31e~prepack: @angular/cdk@2.0.0-beta.10-a7ce31e
14 error cb() never called!
15 error This is an error with npm itself. Please report this error at:
16 error <https://github.com/npm/npm/issues>

我已经尝试过 npm cache clean --force 但我得到了同样的错误.

I already tried npm cache clean --force but i get same error.

node -v v6.10.2
npm -v 5.4.2

推荐答案

我遇到了同样的问题.我解决了

I had the same issue. I resolved it

通过排除 package-lock.json 文件

by excluding package-lock.json file

npm i --no-package-lock

或手动删除 package-lock.json

OR by manually deleting package-lock.json

这篇关于npm 安装错误 - cb() 从未调用过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆