[crash] npm ERR! cb() never called!

priority:medium
triaged
cli

(Lilian) #41

$ npm install
Unhandled rejection RangeError: Maximum call stack size exceeded
at RegExp.test ()
at D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\node_modules\aproba\index.js:38:16
at Array.forEach ()
at module.exports (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\node_modules\aproba\index.js:33:11)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:37:3)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
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! D:\TTFdownloads\nodejs\node_cache_logs\2018-10-01T05_59_58_919Z-debug.log

what’s wrong ???who can tell me how to solve this erro…i have tried many methods,but it still like this


(Daniela Valero) #42

Hello, I also can reproduce this error:

npm verb lock using /Users/dayvaler/.npm/_locks/staging-02645998c96d1929.lock for /Users/dayvaler/workspace/dhl/pt/node_modules/.staging
npm timing audit compress Completed in 1937ms
npm info audit Submitting payload of 176216bytes
npm timing audit submit Completed in 2604ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 2602ms
npm timing audit body Completed in 2ms
npm timing action:extract Completed in 25617ms
npm timing action:finalize Completed in 16350ms
npm timing npm Completed in 143302ms
npm ERR! cb() never called!

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

Under npm 6.1 >

The weird behaviour in my case is that it just stopped working, and starting to crash. I already set the ulimit to unlimited or 1024 or 2000. Still no solution.

Could it be that npm is trying to use more resources than the ones that my computer has available, and therefore crashes? In the activity monitor I see that when I run an install npm uses more than 100% of the cpu.

I have

MacBook Pro (Retina, 15-inch, Late 2013)
with High Sierra 10.12.6 (16G1510)

The only solution I got was to downgrade to npm 5


(John Dixon) #43

This error occurs even on the latest release.

CentOS Linux release 7.5.1804

$ node --version
v10.12.0

$ npm --version
6.4.1

npm ERR! cb() never called!


(Logan Allred) #44

Would it be possible to get a special build of npm with extra debug logging or something to help those of us that experience this regularly to help diagnose it?

Once it starts happening, it is very reproducible and breaks almost every time. I try downgrading npm version, changing Node version, various things until eventually it starts to work again, but the same fixes don’t seem to work every time.

I used to be able to downgrade back to either 5.5 or 5.6 and get working again, but lately with Node 10 that doesn’t always work either.
It takes anywhere from 10 minutes to hours before I can get back working again. It leaves the node_modules in a bad state where sometimes another npm install or npm update will fix it, and sometimes I have to manually delete folders from node_modules and keep re-installing broken packages one by one until my app or tests work again. Removing node_modules completely just causes it fail again, usually about the same place.

It certainly happens either much more often or only on my projects with large dependency trees.

I would be more than happy to install a custom build of npm next time it happens or run with a custom build for a while so that when it happens we will have better odds of finding and fixing the root cause. I’ve been fighting this issue for almost a year, since somewhere in the 5.6 or 5.7 timeframe.


(Luke Pighetti) #45

On LTS node 8.12.0 and npm 6.4.1 I was getting the cb() never called error when trying to do this command in a mono-repo

$ create-react-app my-app --scripts-version=react-scripts-ts

I was able to proceed by using $ n 8.11 which installed 8.11.4 and 5.6.0

The install script now works.

I am on Mac OS X 10.13.6 (17G65)


(Josh Sharpe) #46

osx 10.14, updated npm to 6.4.1 and got this cb() error.


(Joel Chen) #47

I’ve had this problem on my Mac since npm version 5.8.0 and I’ve been stuck at using npm 5.6.0.

I’ve finally got something that seems to point the issue to the number dependencies.

On my machine, with Node 10.9.0 and npm 6.4.1, I got a package.json that fails with this.

If I remove some dependencies, then npm install succeeds.

For example, removing enzyme alone helps.

Removing a bunch of other smaller packages also helps.

Mac is a Mid 2015 MackBook Pro.

MacOS High Sierra 10.13.6.

ulimit output:

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1418
virtual memory          (kbytes, -v) unlimited