Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 [BUG] "npm ERR! cb() never called!" or "Exit handler never called" #417

Closed
darcyclarke opened this issue Nov 8, 2019 · 67 comments
Closed
Assignees
Labels
Bug thing that needs fixing

Comments

@darcyclarke
Copy link
Contributor

darcyclarke commented Nov 8, 2019

*Updated* as of 01/15/2021

Note: Please read this doc before filing a new issue.

@darcyclarke darcyclarke added Bug thing that needs fixing Community labels Nov 8, 2019
@DanielRuf
Copy link

I think we have many reports of the same so these should all be duplicates.

#423
#425
#442
#451
#455
#465

Afaik this is resolved by force-clearing the cache and upgrading / updating to the latest npm version.

@DanielRuf
Copy link

DanielRuf commented Nov 11, 2019

@ruyadorno
Copy link
Contributor

thanks @DanielRuf for linking all those ❤️

@ruyadorno
Copy link
Contributor

#489

@DanielRuf
Copy link

DanielRuf commented Dec 8, 2019

#544
#552
#553
#556
#566
#570
#571
#573
#574
#581
#584
#585
#594
#596
#618
#630
#634

@DanielRuf
Copy link

I guess we can check which version first introduced this (doing a small git bisect) and check the stacktraces for similarities.

@DanielRuf
Copy link

Following versions were mentioned in the issues:

6.4.1
6.9.0
6.10.2
6.12.1
6.13.1
6.13.4

Now trying to get a reproducible testcase.

@DanielRuf
Copy link

Relevant changes in the past tolog this error: npm/npm#15716

@DanielRuf
Copy link

DanielRuf commented Dec 25, 2019

Tests with a local npm 6.13.1 (on macOS):

@vue/cli: not reproducible
npm audit fix: not reproducible
plotly.js: not reproducible
expo-cli: not reproducible

So far it looks like this is caused by other errors which cancel the CLI too early.

I remember that we had this bug also on Ubuntu with the latest version and some packages.

@melvinwallerjr
Copy link

melvinwallerjr commented Jan 4, 2020

I'm experiencing the same error trying to install a company project for development.
Microsoft Windows [Version 10.0.17134.1184]

Using NVM to switch instances of node/npm
node v10.14.2 (64-bit), npm v6.4.1
node v12.4.0 (64-bit), npm v6.9.0

project was generated with Angular CLI version 8.3.21

[NVM for Windows Setup, Ecor Ventures LLC, ‎Tuesday, ‎August ‎7, ‎2018 9:46:31 PM]

@ljharb
Copy link
Contributor

ljharb commented Jan 4, 2020

(note that must be nvm-windows; actual nvm doesn't work on non-WSL Windows, and doesn't distinguish 64-bit)

@mdouglass
Copy link

mdouglass commented Jan 4, 2020

We're getting this error intermittently in both local development and in our CI system. Happy to add any additional logging that might help. Attached the npm log from a run that just happened on my laptop on my mac -- trying to npm install one of our private packages. Immediately re-running the command worked without issue.

npm install @globalworldwide/km-core@latest
2020-01-04T02_02_56_202Z-debug.log

❯ npm -v
6.13.4
❯ node -v
v13.5.0

Let me know if there's anything I can do to help track this down, would like to kill the issue.

@mikemimik mikemimik self-assigned this Jan 13, 2020
@DanielRuf
Copy link

#682

@DanielRuf
Copy link

#671

@DanielRuf
Copy link

#665

@mikemimik
Copy link
Contributor

Actions Triggered:

  • npm audit fix (npm@6.9.0 / node@10.16.1)
  • npm install (npm@6.10.2 / node@12.8.0)
  • sudo npm install -g npm (npm@6.9.0 / node@x.y.z)
  • n/a likely npm i (npm@6.12.1 / node@13.1.0) (npm@6.12.0 / node@12.13.0)
  • npm install (npm@6.4.1 / node@12.13.0)
  • npm install (npm@6.9.0 / node@10.16.1)
  • vue create <app> (npm@6.2.0 / node@10.9.0)

Thoughts as triaging:

  • Seems like there is an error while installing a package that causes this cb() never called! error.
  • There are 42 issues to triage...
  • cb() never called! Can't update NPM or install new #442 original issue references a fix which references updating and cleaning cache to solve issue (updating fixes permissions), cache might indicate problem exists/existed in cacache or pacote
  • cb() never called! #451 seems to have same symptom but cause doesn't seem to be within npm, though it does help point to an issue with while installing a package

@hamzakilic
Copy link

hamzakilic commented May 1, 2021

I got same error. and FIXED IT.
I was trying to dockerize a nodejs project with a docker file. and package.json.
on my ubuntu machine there is no problem, but on CI/CD machine (centos,debian) almost fails to dockerize

Tried Steps:

  • clear node_modules
  • updating node version
  • updating npm version
  • centos
  • debian
  • docker with different versions
  • lots of configuration (npm install fetch-retries, timeouts ....)

My problem:

My problem was at TCP level.
some of the TCP connections to registry.npmjs.org was returning RESET.
with tcpdump I saw that if npm install fails cb() never called, I got TCP RESET packets from registry.npmjs.org ips.
if npm install success, then no TCP RESET from registry.npmjs.org ips.
I dont know why TCP RESET occurs. big network problem

My Solution:
I putted registry.npmjs.org behind of an NGINX proxy on K8
and changed dockerfile
npm install ====> npm install --strict-ssl=false (because nginx will return a default ssl)

docker build -t tag myproject --add-host registry.npmjs.org:nginxip . (redirect all npm install trafic to your nginx)

below is the sample K8 ingress

apiVersion: v1
kind: Namespace
metadata:
  name: gitlab
  labels:
    app.kubernetes.io/name: gitlab
    app.kubernetes.io/part-of: gitlab
---
apiVersion: v1
kind: Service
metadata:
  name: npm-service
  namespace: gitlab
spec:
  externalName: registry.npmjs.org
  type: ExternalName
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-npm-gitlab
  namespace: gitlab
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/upstream-vhost: "registry.npmjs.org"
    nginx.ingress.kubernetes.io/ssl-passthrough: "false"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
    - host: registry.npmjs.org
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: npm-service
                port:
                  number: 443`

`

@KogaiIrina
Copy link

KogaiIrina commented May 2, 2021

Hi! I got this error when I was running npm install
node -v
v14.16.0
npm -v
7.10.0


I solved this problem by updating my npm

@HomyeeKing
Copy link

HomyeeKing commented May 11, 2021

the only suck thing I know is that the warning message of npm publish is indirect and not clear
when you have not verify your email, just tell that they haven't verified the email, not something like security policy thing and package version problem...

@KZRepository
Copy link

npm i
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

fetch GET 304 https://registry.npmjs.org/grunt-cssnano 784ms (from cache)
1900 timing metavuln:packument:grunt-cssnano Completed in 786ms
1901 timing metavuln:load:security-advisory:grunt-cssnano:EtYBVUQGQLlhlpJr8KS/6Ije2vBT1OrDb4ZylGjBbqEpHu5oNhsP45j3VEbnmDsxSDP8IWOiIk4/CNRyBk/RpQ== Completed in 1ms
1902 timing metavuln:cache:put:security-advisory:grunt-cssnano:6zfI7LzZ7jhTaIHReTadx2z1+1e771qctuX2ezhF2HjxeHbwezKe6xIw4RwD9LlZN7IMyqdkoz3KNhgkx78nwQ== Completed in 10ms
1903 timing metavuln:calculate:security-advisory:grunt-cssnano:EtYBVUQGQLlhlpJr8KS/6Ije2vBT1OrDb4ZylGjBbqEpHu5oNhsP45j3VEbnmDsxSDP8IWOiIk4/CNRyBk/RpQ== Completed in 797ms
1904 timing auditReport:init Completed in 24937ms
1905 timing reify:audit Completed in 27613ms
1906 http fetch GET 200 https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz 25743ms
1907 timing reifyNode:node_modules/caniuse-lite Completed in 27883ms
1908 timing npm Completed in 43488ms
1909 error cb() never called!
1910 error This is an error with npm itself. Please report this error at:
1911 error https://github.com/npm/cli/issues

@Ubaid-Ali
Copy link

Worked for me but I don't know is it true or not,

I was getting the same error when I was trying to install "netlify-cli" command is C:Users>MyName>npm install netlify-cli -g,
I upgraded npm version LTS to LATEST with this command >npm i -g npm@latest,
Still not work then,
I just deleted the log file from here ~/AppData/Local/npm-cache/_logs/2021-05-19T18_46_01_599Z-debug.log using git bash,
$ rm ~/AppData/Local/npm-cache/_logs/2021-05-19T18_46_01_599Z-debug.log,
which was showing with the error in cli,
Try again, Installed Successfully.

@RedHoodJT1988
Copy link

Hello, I ma receiving this error while using WSL2 Ubuntu 20.04. I have installed node and npm via nvm. I am trying to run npx create-react-app projectname but I keep running into the issue. I am not sure what is causing it as I have the latest version of both npm and npx. Any assistance on this would be very helpful. Thanks.

@ljharb ljharb mentioned this issue May 25, 2021
1 task
@darcyclarke darcyclarke changed the title "npm ERR! cb() never called!" 🐞 "npm ERR! cb() never called!" Jun 2, 2021
@darcyclarke darcyclarke changed the title 🐞 "npm ERR! cb() never called!" 🐞 [BUG] "npm ERR! cb() never called!" Jun 2, 2021
@npm npm locked as resolved and limited conversation to collaborators Jun 2, 2021
@darcyclarke darcyclarke changed the title 🐞 [BUG] "npm ERR! cb() never called!" 🐞 [BUG] "npm ERR! cb() never called!" Jun 7, 2021
@darcyclarke darcyclarke removed the Release 6.x work is associated with a specific npm 6 release label Jun 7, 2021
@wraithgar wraithgar changed the title 🐞 [BUG] "npm ERR! cb() never called!" 🐞 [BUG] "npm ERR! cb() never called!" or "Exit handler never called" Jun 23, 2021
@darcyclarke darcyclarke unpinned this issue Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests