Angular 6: npm ERR! cb() never called when installing angular cdk

故事扮演 提交于 2019-12-24 02:55:13

问题


I am installing angular material here is what I have done

Angular material successfull installed by the following command

   1.npm install --save @angular/material 

Angula CDK fail to install by using the following command

  1.npm install --save @angular/cdk

I get the following error in 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

Fo reference I never had this problem, this happend after I uninstalled the cdk and angular material so now I am trying to install it again ,

what do I need to do to solve this problem?


回答1:


After googling here is the solution i found

npm cache clean --force



回答2:


The best way to resolve is update the npm version and install again.

npm install -g npm




回答3:


I had the same issue and I installed it by excluding package-lock.json using below command

npm i --save @angular/cdk --no-package-lock

OR manually deleting package-lock.json




回答4:


In my case problem is due to space not enough in the disk. So I cleaned up some space. Problem get solved.



来源:https://stackoverflow.com/questions/51525210/angular-6-npm-err-cb-never-called-when-installing-angular-cdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!