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

triaged
cli
priority:medium

(Kat Marchán) #62

Hey y’all!

tl;dr try this: $ npx npmc@latest install

I’ve released a new npm canary with some patches that will stop dropping cb never called errors when certain error types pop up. Note that you may very well still get an error, but it should be more informative now, and I assume it’s going to be the ENFILE issue in most cases. I have a different idea for those, so if you confirm that, I can try the new thing and release a new canary.

Thanks y’all for your patience, I assure you this bug has been as exasperating for me as I imagine as it’s been for you. Kudos to @iarna for finally managing to reproduce it on her own server, which allowed her to do deeper debugging and come up with a patch.

Anyway, please let me know if you still get the cb never called with the canary!


(Zxylina) #63

中国windows以及linux环境,复现:
rm -rf node_modules package-lock.json && npm cache clear --force
npm i
尝试了版本:
13:22:53 + npm --version
13:22:53 5.6.0
13:22:53 + node --version
13:22:53 v8.10.0

13:20:36 + npm --version
13:20:39 6.5.0
13:20:39 + node --version
13:20:39 v8.11.3

13:28:24 + npm --version
13:28:24 5.6.0
13:28:24 + node --version
13:28:24 v8.11.1

解决:
更换npm的镜像源:
1.临时使用

npm --registry https://registry.npm.taobao.org install express
1
2.持久使用

npm config set registry https://registry.npm.taobao.org
1
配置后可通过下面方式来验证是否成功
npm config get registry

npm info express
3.通过cnpm使用

npm install -g cnpm --registry=https://registry.npm.taobao.org
1
使用
cnpm install express

node采用源码包tar.gz安装,windows使用nvm安装
安装node之后会自动安装一个npm,如想安装指定版本npm:npm install -g npm@5.0.0


(Zxylina) #64

发现的原因是使用cnpm install,node_modules即可正常下载,不然会报错


(Gabriel Hayes) #65

Getting the same error (after a series of strange cryptic issues while trying to start up a new webpack project)

See error log:
https://pastebin.com/ui3Xk74W


(Kaifas Stromai) #66

Greetings, persons,
I am very new to node/npm/web development but I think I might have figured it out (at least for me (Windows 10 build 17763)).
When ever I ran npm install I noticied that Windows defender cpu usage would suddenly spike–so I added an exception in the settings and voila! no more cb() never called! Given this, I would posit that perhaps anti-malware processes are interfering with the install process?


(Kat Marchán) #67

Could you please try again using the canary?


(Rupesh H Bhurke) #68

Hi!

I received a similar error while trying:
npm install

Unhandled rejection Error: Command failed: C:\Program Files\Git\cmd\git.EXE checkout 4.0o D:\Rupesh\WorkData\Self\RnD\Node.js\json-forms\aurelia-formio\exam
error: pathspec '4.0' did not match any file(s) known to git.

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

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!     C:\Users\Rupesh\AppData\Roaming\npm-cache\_logs\2019-01-03T10_59_11_787Z-debug.log

I cloned from: https://github.com/formio/aurelia-formio

cd aurelia-formio
npm install
cd example
npm install  <-- here I received this error!

My Node version is 10.14.2
My NPM version is 6.4.1
My OS is Microsoft Windows [Version 10.0.17134.472]

Kindly suggest workaround!

Thank you
Rupesh


(Lars Willighagen) #69

Seems like the 4.0 tag doesn’t exist anymore in the gulp repository, but is still required here.


(Kumavis) #70

verifying error improvement on canary :+1:

npm@6.6.0

npm ERR! cb() never called!

npmc@latest

npm ERR! EMFILE: too many open files, scandir '/home/user/.npm/_npx/31857'

Resimdeki Hatayı Anlayamadım..
npm ERR! This is an error with npm itself. Please report this error at: npm ERR! <https://npm.community>
(Peter Willert) #71

Confirming this observation.

I wonder if there is a way to let npmc run in some kind of a sequential install mode to work around the issue for now. :open_hands: