cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open darcyclarke opened this issue 7 years ago • 67 comments

*Updated* as of 01/15/2021

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

darcyclarke avatar Nov 08 '19 05:11 darcyclarke

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

https://github.com/npm/cli/issues/423 https://github.com/npm/cli/issues/425 https://github.com/npm/cli/issues/442 https://github.com/npm/cli/issues/451 https://github.com/npm/cli/issues/455 https://github.com/npm/cli/issues/465

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

DanielRuf avatar Nov 11 '19 06:11 DanielRuf

https://github.com/npm/cli/issues/303 https://github.com/npm/cli/issues/306 https://github.com/npm/cli/issues/325 https://github.com/npm/cli/issues/353 https://github.com/npm/cli/issues/369 https://github.com/npm/cli/issues/370 https://github.com/npm/cli/issues/375 https://github.com/npm/cli/issues/383 https://github.com/npm/cli/issues/408 https://github.com/npm/cli/issues/418 https://github.com/npm/cli/issues/448 https://github.com/npm/cli/issues/474 https://github.com/npm/cli/issues/499 https://github.com/npm/cli/issues/522

DanielRuf avatar Nov 11 '19 06:11 DanielRuf

thanks @DanielRuf for linking all those ❤️

ruyadorno avatar Nov 11 '19 18:11 ruyadorno

#489

ruyadorno avatar Nov 19 '19 22:11 ruyadorno

https://github.com/npm/cli/issues/544 https://github.com/npm/cli/issues/552 https://github.com/npm/cli/issues/553 https://github.com/npm/cli/issues/556 https://github.com/npm/cli/issues/566 https://github.com/npm/cli/issues/570 https://github.com/npm/cli/issues/571 https://github.com/npm/cli/issues/573 https://github.com/npm/cli/issues/574 https://github.com/npm/cli/issues/581 https://github.com/npm/cli/issues/584 https://github.com/npm/cli/issues/585 https://github.com/npm/cli/issues/594 https://github.com/npm/cli/issues/596 https://github.com/npm/cli/issues/618 https://github.com/npm/cli/issues/630 https://github.com/npm/cli/issues/634

DanielRuf avatar Dec 08 '19 14:12 DanielRuf

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

DanielRuf avatar Dec 25 '19 18:12 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.

DanielRuf avatar Dec 25 '19 19:12 DanielRuf

Relevant changes in the past tolog this error: https://github.com/npm/npm/pull/15716

DanielRuf avatar Dec 25 '19 19:12 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.

DanielRuf avatar Dec 25 '19 19:12 DanielRuf

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]

melvinwallerjr avatar Jan 04 '20 00:01 melvinwallerjr

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

ljharb avatar Jan 04 '20 00:01 ljharb

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.

mdouglass avatar Jan 04 '20 02:01 mdouglass

https://github.com/npm/cli/issues/682

DanielRuf avatar Jan 14 '20 06:01 DanielRuf

https://github.com/npm/cli/issues/671

DanielRuf avatar Jan 14 '20 06:01 DanielRuf

https://github.com/npm/cli/issues/665

DanielRuf avatar Jan 14 '20 06:01 DanielRuf

Actions Triggered:

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...
  • https://github.com/npm/cli/issues/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
  • https://github.com/npm/cli/issues/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

mikemimik avatar Jan 17 '20 23:01 mikemimik

It's shocking how few people know how to use a search bar...

puppy0cam avatar Feb 04 '20 01:02 puppy0cam

Does anyone have ANY idea what might be causing this?

Are there any workarounds?

When I run my npm install locally, on windows 10, everything works fine.

When I run my npm install on dev.azure.com, on a 64bit Amazon Linux/4.13.0 machine, I get the following error :

120982 error cb() never called!
120983 error This is an error with npm itself. Please report this error at:
120984 error <https://npm.community>

I tried upgrading my Node environment from Node 10 to Node 12, as I was also running Node 12 locally, but this did not seem to have any impact whatsoever.

I have no idea what to do with this, and this issue is totally blocking!!

jslegers avatar Feb 12 '20 19:02 jslegers

Hey @jslegers sorry to hear you're blocked!

In my initial research into the issue, I noted that the issue https://github.com/npm/cli/issues/442 referenced our community page which had a link to a possible solution for you. Clearing the cache seemed to solve the issue for some. I would suggest giving that a try to see if you can unblock your work.

mikemimik avatar Feb 17 '20 07:02 mikemimik

Hey @jslegers sorry to hear you're blocked!

In my initial research into the issue, I noted that the issue #442 referenced our community page which had a link to a possible solution for you. Clearing the cache seemed to solve the issue for some. I would suggest giving that a try to see if you can unblock your work.

Thanks for the tip!

I did eventually manage to find a solution on my own.

Apparently, the issue was caused by my making some changes to the local package structure. As part of an ongoing refactoring attempt, I got rid of a one-size-fits-all kind of unscoped package and replaced it with a bunch of small scoped packages. Apparently, this confused NPM and caused the npm ERR! cb() never called! bug.

In seems to have been fixed by deleting my package-lock.json file and pushing that deletion to the remote branch where this issue occurred.

jslegers avatar Feb 17 '20 09:02 jslegers