Skip to content

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

Closed

Description

@darcyclarke

*Updated* as of 01/15/2021

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

Activity

  1. DanielRuf commented on Nov 11, 2019

    @DanielRuf

    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.

  2. DanielRuf commented on Nov 11, 2019

    @DanielRuf
  3. ruyadorno commented on Nov 11, 2019

    @ruyadorno
    Contributor

    thanks @DanielRuf for linking all those ❤️

  4. ruyadorno commented on Nov 19, 2019

    @ruyadorno
    Contributor
  5. DanielRuf commented on Dec 8, 2019

    @DanielRuf
  6. DanielRuf commented on Dec 25, 2019

    @DanielRuf

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

  7. DanielRuf commented on Dec 25, 2019

    @DanielRuf

    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.

  8. DanielRuf commented on Dec 25, 2019

    @DanielRuf

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

  9. DanielRuf commented on Dec 25, 2019

    @DanielRuf

    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.

  10. melvinwallerjr commented on Jan 4, 2020

    @melvinwallerjr

    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]

  11. ljharb commented on Jan 4, 2020

    @ljharb
    Contributor

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

  12. mdouglass commented on Jan 4, 2020

    @mdouglass

    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.

  13. self-assigned this
    on Jan 13, 2020
  14. 60 remaining items

  15. Karmavil commented on Apr 19, 2021

    @Karmavil

    Hi. thanks for this note it was helpful:

    Updated as of 01/15/2021

    Note: Please read this doc before filing a new issue or adding a comment to this thread.

    I'm not going to give you too many details basically because I will probably give you wrong or not related information but I solved this issue that in my case it was related with this specific package as a dependency: amplify-cli (npm intall --save amplify-cli)

    This is what happened

    • I removed the package.
    • I upgrade npm
    • I tried to install amplify-cli with save again then I got the ERR! cb() error

    Details:

    • I had installed this package before (as I said)
    • I had installed this dependencies: graphql and @types/grapthl (I cannot tell if it was a mistake install those)
    • I remove them, then ran npm install --save amplify-cli and the install worked fine (this package was the one giving me the ERR! cb() error message)

    I understand this errors are specific, but maybe it could be helpful if this thing about @types/ is the problem

    Important

    Now I'm in a nightmare called Try npm install @types/graphql if it exists so take you time and think twice if you're gonna do that 🙅🏽 I cannot remember how did I solve this before

    Solved

    Jesus! that was horrible.. The only way I could solve that try to intall bulls~~ was restarting the container after npm install --save but I did it before without restart and it did not work.. I cannot imagine if it is a problem with VScode, angular, npm, cache.. you name it. Luck for me it was a container

  16. hamzakilic commented on May 1, 2021

    @hamzakilic

    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`
    
    `
    
  17. KogaiIrina commented on May 2, 2021

    @KogaiIrina

    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

  18. HomyeeKing commented on May 11, 2021

    @HomyeeKing

    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...

  19. KZRepository commented on May 11, 2021

    @KZRepository

    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

  20. Ubaid-Ali commented on May 19, 2021

    @Ubaid-Ali

    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.

  21. RedHoodJT1988 commented on May 24, 2021

    @RedHoodJT1988

    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.

  22. changed the title [-]"npm ERR! cb() never called!"[/-] [+]🐞 `"npm ERR! cb() never called!"`[/+] on Jun 2, 2021
  23. changed the title [-]🐞 `"npm ERR! cb() never called!"`[/-] [+]🐞 [BUG] `"npm ERR! cb() never called!"`[/+] on Jun 2, 2021
  24. locked as resolved and limited conversation to collaborators on Jun 2, 2021
  25. changed the title [-]🐞 [BUG] `"npm ERR! cb() never called!"`[/-] [+]🐞 [BUG] "npm ERR! cb() never called!"[/+] on Jun 7, 2021
  26. removed
    Release 6.xwork is associated with a specific npm 6 release
    on Jun 7, 2021
  27. changed the title [-]🐞 [BUG] "npm ERR! cb() never called!"[/-] [+]🐞 [BUG] "npm ERR! cb() never called!" or "Exit handler never called"[/+] on Jun 23, 2021
  28. unpinned this issue on Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions