Deep Shah
Deep Shah

Reputation: 125

npm ERR! cb() never called

I was trying to download expo cli and I got error:-

C:\WINDOWS\system32>npm i -g expo-cli
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/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Local\npm-cache\_logs\2021-03-03T14_02_14_809Z-debug.log

I also used npm cache clean --force. But it didn't work too😥

C:\WINDOWS\system32>npm -v
7.6.0

C:\WINDOWS\system32>node -v
v14.16.0

Please help me......

And after doing npm i -g npm it worked!!!!!!

But when I tried to install or download any packages then error:

E:\React-native\practice>npm i react-native-elements
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/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Local\npm-cache\_logs\2021-03-04T05_03_20_067Z-debug.log

So what is wrong going on?

Upvotes: 6

Views: 25257

Answers (7)

bakrall
bakrall

Reputation: 633

I did the following steps:

  1. delete node_modules
  2. remove package-lock.json
  3. run npm cache clean --force
  4. run npm install --force

npm install --force was the key to success, because even after doing 1-2 steps, normal npm install resulted in same problem

Upvotes: 3

Dasun wijesundara
Dasun wijesundara

Reputation: 696

You can try to force clean the npm cache

npm cache clean --force

Upvotes: 1

Alex Santos
Alex Santos

Reputation: 21

I had the same problem in all npm package that I tried to download, and solved just running this command in my Windows CMD.

npm set strict-ssl true

Upvotes: 1

Imran Shaikh
Imran Shaikh

Reputation: 21

I've had the same problem, and was able to fix it by adding the flag --legacy-peer-deps to the installation command. For instance:

npm i --legacy-peer-deps package-name

Upvotes: 2

dino
dino

Reputation: 203

I had the same problem and solved it with checking my proxxy settings in C:\Users\username.npmrc

here are the settings for the proxy.

proxy=...
https-proxy=...
strict-ssl=false
registry=...

You can set these things through npm with the following:

 npm config set proxy ...
 npm config set https-proxy ...
 npm config set strict-ssl false
 npm config set registry ...

Maybe you have to remove proxy and https-proxy to make it work.

Upvotes: 1

Cognisun Inc
Cognisun Inc

Reputation: 446

If you are using npm version 5 or above:

Try following command:

$ sudo npm cache verify

OR

$ sudo npm cache clean --force

Upvotes: 4

user10384449
user10384449

Reputation: 168

Run npm install -g npm & npm cache clean

Upvotes: 2

Related Questions