角度6:npm错误!安装角度cdk时从未调用过cb()

use*_*622 2 npm angular-material npm-install angular

我在这里安装角材

通过以下命令成功安装角材料

   1.npm install --save @angular/material 
Run Code Online (Sandbox Code Playgroud)

使用以下命令无法安装Angula CDK

  1.npm install --save @angular/cdk
Run Code Online (Sandbox Code Playgroud)

我在cmd中收到以下错误:

npm WARN tar zlib error: unexpected end of file
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Bonge\AppData\Roaming\npm-cache\_logs\2018-07-25T17_44_24_771Z-debug.log
Run Code Online (Sandbox Code Playgroud)

参考,我从来没有遇到过这个问题,这是在我卸载cdk和angular材料之后发生的,所以现在我尝试再次安装它,

我需要怎么做才能解决这个问题?

use*_*622 5

谷歌搜索后,这是我找到的解决方案

npm cache clean --force
Run Code Online (Sandbox Code Playgroud)


小智 5

最好的解决方法是更新npm版本并重新安装。

npm 安装-g npm