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

24,474

Solution 1

After googling here is the solution i found

npm cache clean --force

Solution 2

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

npm install -g npm

Solution 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

Solution 4

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.

Share:
24,474

Related videos on Youtube

The Dead Man
Author by

The Dead Man

Updated on March 26, 2021

Comments

  • The Dead Man
    The Dead Man about 3 years

    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?

    • smnbbrv
      smnbbrv almost 6 years
      Just a comment: it is way easier to install material by running ng add @angular/material. It does all the dirty job for you
  • kumar chandraketu
    kumar chandraketu over 4 years
    i had fixed same issue. see this link stackoverflow.com/questions/52467848/…