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

cli
priority:medium
triaged

(Gil Barbara) #1

What I Wanted to Do

npm install to complete without errors

What Happened Instead

The process stopped without giving any description or writing a log

Reproduction Steps

A fresh install with this package: https://gist.github.com/gilbarbara/6c4d8851898bf1eb2968876cb6c1fd8d

Details

In my preliminary tests, I’ve found that removing cypress, stylelint* and webpack* cleared the error.

no log generated

Platform Info

$ npm --versions
6.2.0
$ node -p process.platform
darwin

npm error installing dependencies for https://github.com/ConsenSys/diligence-takehome/ after reinstalling node
npm ERR! cb() never called!
npm ERR! cb() never called! error while installing npm install -g nativescript
error during npm install version 8
i get error when i run npm install in webpack source code
(Kat Marchán) #2

I still can’t reproduce this with your repo, but this is a known thing I’ve been trying to track down. I don’t really know why it’s happening and it seems to have to do with how the CLI is handling registry hangups.

This is technically a duplicate of npm ERR! cb() never called!, but I’m gonna close that one in favor of this one because this one’s actually formatted like a bug report, and it’s definitely a bug.


(Gil Barbara) #3

Just to clarify this only happens on MacOS X 10.3.4 and up. (tested on 3 machines)
A dev on my team could install this package without problems on windows.


(ajv) #4

Also seeing this when trying to create a new Vue project with the new vue-cli.
I’m on OSX 10.13.3 | node 10.6 | npm 6.1

Vue CLI v3.0.0-rc.5
⠋  Creating project in /Users/antc/code/qualitista/training-wheels.hasProjectGit /Users/antc/code/qualitista/training-wheels false
✨  Creating project in /Users/antc/code/qualitista/training-wheels.
🗃  Initializing git repository...
⚙  Installing CLI plugins. This might take a while...

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/npm/issues>
 ERROR  command failed: npm install --loglevel error

I’m unfortunately unable to run the install with the error loglevel, as it’s hidden somewhere deep within vue create and vue create -- --loglevel error didn’t help, sorry :confused:

The last phase of the install that I see is refresh-package-json before it fails:

⸨            ░░░░░░⸩ ⠹ refresh-package-json:eventsource: sill refresh-package-json

(Cory Jones) #5

npm.log (1.6 MB)

Attached is a failed install log. Every install I do, even a small sample project (in this casedebug-level), this error occurs. MacOS Sierra 10.12.6, npm version 6.2.0, node 10.7.0.


(Luke Horvat) #6

I encountered this error today after upgrading from npm 5 to 6 (on OS X 10.13.5) and managed to “fix” it.

For context, I’ve been running npm install via a shell script that does a bunch of “setup” stuff. The script was setting the file descriptor limit (e.g. ulimit -n 2000) prior to npm install. I discovered that increasing the limit (e.g. ulimit -n 20000) made the error go away.

So I guess it’s due to the number of parallel read-writes to the filesystem that npm 6 is doing?


(David Bouman) #7

If it helps, for me (MacOS also) this behaviour started happening with npm@5.7.0 and has consistently continued with every release since; So, whatever the cause, likely it got introduced there.


(David Bouman) #8

Confirmed! Raising the ulimit -n does fix it for me.

As it turns out, the max open file limit was being set to a measly ulimit -n 1024 during shell startup. This got both the soft- and the hard limit set, the latter of which subsequently prevented any attempts to raise it afterwards.

Removing that line restored these soft and hard limits to the system defaults of 256 (as reported by ulimit -Sn) and unlimited (ulimit -Hn) respectively, of which the latter now apparently enables npm install to complete without throwing a fit.

So @zkat, maybe setting your ulimit -n 1024 (or lower) will enable you to finally reproduce the behaviour.


(Ebrahim A Gharavol) #9

I am trying to run
npm install -g composer-rest-server@0.19

on Ubuntu 16.04 on a virtual machine,
I tried ulimit -n 20000,
and unfortunately, still getting a similar error.


(David Bouman) #10

Just to be sure, after setting it, does ulimit -Hn actually report a setting of 20000? What does it report before you set it?


(Tumi Debrah) #11

I have been not been able to run npm install on y laravel 5.6 and 5.3 projects i have tried several fixes availabe like the the forced cache clear and node reinstallation but npm install still gives npm ERR! cb() never called! I attached the error log file. Someone pls help 2018-08-06T10_42_03_250Z-debug.log (527.2 KB)


(Tumi Debrah) #12

Sir pls am fairly new to programming how do you increase the ulimit -n 20000 I am building a laravel 5.6 project and am running node

v8.11.3 and npm 5.6.0


(Ebrahim A Gharavol) #13

ulimit -Hn reports 65536 now, and interestingly nothing changed from this morning!
And interestingly, the installation went through right now! : thinking: I do not believe in magic, but it seems we need a witch hunt on my laptop. The major change is with my ISP.


(David Bouman) #14

I usually find that a second npm install simply succeeds when run in succession to a failed one.

Assuming that the ulimit -Hn setting is the main culprit here, this actually makes sense, because there’s simply less stuff left to install the second time round; some dependencies will have installed just fine on the first attempt and so your node_modules will already be partly populated.

But whether this will result in a healthy node_modules set without defects, I do not know.


(Jonathan Lurie) #15

I am new NPM. On a private NON-PRODUCTION VSTS build server when running the build I get the following

2018-08-06T09:55:18.7756640Z ##[section]Starting: npm install
2018-08-06T09:55:18.7763942Z ==============================================================================
2018-08-06T09:55:18.7764339Z Task : npm
2018-08-06T09:55:18.7765502Z Version : 1.0.18
2018-08-06T09:55:18.7765850Z Author : Microsoft Corporation
2018-08-06T09:55:18.7766266Z Help : [More Information]
2018-08-06T09:55:18.7766676Z ==============================================================================
2018-08-06T09:55:19.7790108Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” --version”
2018-08-06T09:55:20.9928629Z 6.2.0
2018-08-06T09:55:21.0104520Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:21.5358954Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:22.3758546Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:22.3759849Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:24.6073857Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” config list”
2018-08-06T09:55:25.7805131Z ; cli configs
2018-08-06T09:55:25.7805829Z metrics-registry = “https://aginsurance.pkgs.visualstudio.com/_packaging/6364c17f-4ff3-4f73-ba33-933dedfa64b1/npm/registry/
2018-08-06T09:55:25.7806315Z scope = “”
2018-08-06T09:55:25.7806627Z user-agent = “npm/6.2.0 node/v10.8.0 win32 x64”
2018-08-06T09:55:25.7806860Z
2018-08-06T09:55:25.7807564Z ; environment configs
2018-08-06T09:55:25.7807977Z https-proxy = “redacted”
2018-08-06T09:55:25.7808357Z proxy = “redacted”
2018-08-06T09:55:25.7808806Z strict-ssl = false
2018-08-06T09:55:25.7809201Z userconfig = “D:\VSTS Agents\Agent1\_work\13\npm\4731.npmrc”
2018-08-06T09:55:25.7809490Z
2018-08-06T09:55:25.7809857Z ; userconfig D:\VSTS Agents\Agent1_work\13\npm\4731.npmrc
2018-08-06T09:55:25.7810369Z registry = “https://aginsurance.pkgs.visualstudio.com/_packaging/6364c17f-4ff3-4f73-ba33-933dedfa64b1/npm/registry/
2018-08-06T09:55:25.7810667Z
2018-08-06T09:55:25.7811049Z ; node bin location = D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\node.exe
2018-08-06T09:55:25.7811438Z ; cwd = D:\VSTS Agents\Agent1_work\13\s
2018-08-06T09:55:25.7811909Z ; HOME = C:\Users\VSTSDSRVC
2018-08-06T09:55:25.7812261Z ; “npm config ls -l” to show all defaults.
2018-08-06T09:55:25.7812506Z
2018-08-06T09:55:25.7829765Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” install”
2018-08-06T09:59:04.8086311Z npm ERR! cb() never called!
2018-08-06T09:59:04.8087446Z
2018-08-06T09:59:04.8088966Z npm ERR! This is an error with npm itself. Please report this error at:
2018-08-06T09:59:04.8090109Z npm ERR! https://npm.community
2018-08-06T09:59:04.8090299Z
2018-08-06T09:59:04.8090742Z npm ERR! A complete log of this run can be found in:
2018-08-06T09:59:04.8092220Z npm ERR! C:\Users\VSTSDSRVC\AppData\Roaming\npm-cache_logs\2018-08-06T09_59_04_709Z-debug.log
2018-08-06T09:59:05.0370485Z Found npm debug log, make sure the path matches with the one in npm’s output: C:\Users\VSTSDSRVC\AppData\Roaming\npm-cache_logs\2018-08-06T09_59_04_709Z-debug.log

I have searched the rather large log file but there doesn’t appear to be any additional useful information: just this at the end:

18242 error cb() never called!
18243 error This is an error with npm itself. Please report this error at:
18244 error https://npm.community

I do not get this error on the PRODUCTION build server which is running npm 5.6.

However on the PRODUCTION build servers I have a different issue altogether which I am still investigating: 3 minute+ delay when trying to run: npm.cmd --version.

Any advice most welcome and appreciated.

Thanks!


(Joiey Seeley) #16

I’m seeing this same issue on NPM 6.1.0 on macOS High Sierra (10.13.6)

I raised the ulimit to 20000 as mentioned in one of the above replies, but this had no impact.

Here is the report from the log file.

silly extract babel-plugin-jsx-vue-functional@2.1.0
timing npm Completed in 367558ms
error cb() never called!
error This is an error with npm itself. Please report this error at:
error <https://github.com/npm/npm/issues>

(Ebrahim A Gharavol) #17

It seems that in my case, every thing is OK.


(Jonathan Lurie) #18

Issue was this morning resolved without any changes. Also the issue of npm commands taking several minutes was resolved by moving from 5.6 to 6.1/6.2/6.3


(Jonathan Grimes) #19

It is certainly not resolved. I have a teammate who is stuck on npm 5.6 because all newer versions exhibit this issue. (always starting installs fresh… never continuing with existing node_modules)

I have yet to find the culprit for it.


(Gil Barbara) #20

Changing the ulimit helped.
I followed these instructions for Mac OS 10.12 and up: https://unix.stackexchange.com/a/293062