10

I was trying to run npm install inside the project folder but every time there is this error showing npm cb() never called.

I am using node version 10.16.2 and npm version 6.9.0 in windows 10

I have tried npm cache clean --force but that didn't help

E:\contribution\contribute-to-open-source>npm install
npm ERR! cb() never called!

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

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\papun\AppData\Roaming\npm-cache\_logs\2019-08-10T03_51_20_512Z-debug.log
richard937
  • 199
  • 2
  • 3
  • 11

7 Answers7

35

I had the same problems and lost hours trying to solve it :(.

But then i found out that my firm has installed some new kind of firewall with self signed certificate.

Quick solution was:

npm config set strict-ssl=false

After that everything started working without 'npm cb() never called' errors

Matjaz
  • 1,301
  • 10
  • 7
5

I had faced the same issue, and i spend days to get a solution for the issue. In the end, i figured it out and it was an issue with my network.

Please verify your network connection and proxy settings.

In my case, I was using corporate proxy using a script. When i opened the pac file and get the proxy from there ( take XXX:XXX from the line return "PROXY XXX:XXX;";) and added to npm config proxy setting (npm config set proxy XXX:XXX), it started working and got resolved.

Amalraj K R
  • 71
  • 1
  • 3
5

run this all issue will be solved..

 npm install --global windows-build-tools
3

try to set your proxy using the commands

  • npm config set proxy http://proxy_host:port
  • npm config set https-proxy https://proxy_host:port
RuchDi
  • 31
  • 1
1

I have deleted all the node_modules, package-lock.json but still it was not working. For me the reason was, there were some modules that required relogin to install.

So, I deleted my node_modules, build and package-lock.json. and opened command prompt in admin mode.

Then went to the specific project path and logged-in to the components that require credentials.

1. npm login (root path of your react app)
2. type username as "<xxxxx>"
3. type password as "<yyyyy>" (won't be visible on console)
4. type email as "<zzzz>@<aaa>.com"
5. npm i
6. npm run build

It worked for me.

KushalSeth
  • 3,265
  • 1
  • 26
  • 29
0

I also faced the same problem I deleted that file from

C:\Users\Harshk1311\AppData\Roaming\npm-cache\_logs

And problem solved

  • Double Check file name in terminal where error occured and delete file
  • i.e C:\Users\Harshk1311\AppData\Roaming\npm-cache_logs\2019-08-10T03_51_20_512Z-debug.log
  • Delete 2019-08-10T03_51_20_512Z-debug.log only this file .
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Harsh Kairamkonda
  • 387
  • 1
  • 6
  • 18
0

Another possible reason that solved the problem in my case:

Missing MS VC Redistributable. For example if you are on a fresh new PC. In this case you could download the e.g. VC_redist.x64.exe and install it. You may need to restart the terminal before e.g. executing npm i again.

The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.

Domske
  • 4,795
  • 2
  • 20
  • 35