简体   繁体   English

npm 错误。 cb.apply 在执行时不是 function > npm install @angular/cli@latest

[英]npm ERR! cb.apply is not a function while doing > npm install @angular/cli@latest

I am getting this error "npm ERR. cb:apply is not a function" in windows while doing:在执行以下操作时,我在 windows 中收到此错误“npm ERR.cb:apply is not a function”:

> npm install 

I have also tried with:我也尝试过:

> npm install @angular/cli@latest

And the error is the same, this is the file.log:错误是一样的,这是file.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '@angular/cli@latest'
1 verbose cli ]
2 info using npm@5.0.3
3 info using node@v14.15.1
4 verbose npm-session f3412af9e2e7111f
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose stack TypeError: cb.apply is not a function
7 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
7 verbose stack     at FSReqCallback.oncomplete (fs.js:184:5)
8 verbose cwd E:\...
9 verbose Windows_NT 10.0.15063
10 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@angular/cli@latest"
11 verbose node v14.15.1
12 verbose npm  v5.0.3
13 error cb.apply is not a function
14 verbose exit [ 1, true ]

You can see, that the problem derives from your current npm package.您可以看到,问题源于您当前的npm package。

7 verbose stack TypeError: cb.apply is not a function
7 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18

Your version of npm is pretty old.您的 npm 版本相当旧。

2 info using npm@5.0.3

We're currently at 7.9.0.我们目前是 7.9.0。 Please run请运行

npm install -g npm@7.9.0

and then try to install angular cli again.然后尝试再次安装 angular cli。 This will surely do the trick.这肯定会成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM