7

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?

The Dead Man
  • 6,258
  • 28
  • 111
  • 193
  • 1
    Just a comment: it is way easier to install material by running `ng add @angular/material`. It does all the dirty job for you – smnbbrv Jul 25 '18 at 18:37

6 Answers6

16

After googling here is the solution i found

npm cache clean --force
The Dead Man
  • 6,258
  • 28
  • 111
  • 193
5

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

npm install -g npm

user10471372
  • 51
  • 1
  • 1
1

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

Hemadri Dasari
  • 32,666
  • 37
  • 119
  • 162
1

Since NPM 6 you can do clean install.

npm clean-install

That would try to remove the node modules folder and safely install the packages by checking the package-lock.json.

P.S. If that fails for some reason, check here for troubleshooting.

Just Shadow
  • 10,860
  • 6
  • 57
  • 75
0

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

Himanshu Joshi
  • 100
  • 1
  • 5
  • i had fixed same issue. see this link https://stackoverflow.com/questions/52467848/npm-err-cb-never-called-error-when-trying-to-run-npm-install-command/58089750#58089750 – kumar chandraketu Sep 25 '19 at 00:50
0

I faced same issue. (cb() never called!). In my case folder has not read/write permission. Check your folder permission assign read/write permission to fix the issue.

Maulik Parmar
  • 857
  • 10
  • 15