Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

"npm ERR! cb() never called" when installing npm dependencies #1190

mitar opened this Issue Jun 28, 2013 · 13 comments


None yet
6 participants

mitar commented Jun 28, 2013

When trying to install a large npm tarball dependency (7.9 MB) I get an error:

Error: Command failed: npm http GET https://github.com/peerlibrary/pdf.js/tarball/d48097845fa4fb4e00fe895d0412872535ad0730

at Object.Future.wait (/home/travis/.meteor/tools/cc18dfef9e/lib/node_modules/fibers/future.js:322:15)
at Object._.extend._execFileSync (/home/travis/.meteor/tools/cc18dfef9e/tools/meteor_npm.js:231:10)
at Object._.extend._installNpmModule (/home/travis/.meteor/tools/cc18dfef9e/tools/meteor_npm.js:342:10)
at _.extend._createFreshNpmDirectory (/home/travis/.meteor/tools/cc18dfef9e/tools/meteor_npm.js:192:12)
at Function._.each._.forEach (/home/travis/.meteor/tools/cc18dfef9e/lib/node_modules/underscore/underscore.js:86:24)
at Object._.extend._createFreshNpmDirectory (/home/travis/.meteor/tools/cc18dfef9e/tools/meteor_npm.js:191:7)
at Object._.extend.updateDependencies (/home/travis/.meteor/tools/cc18dfef9e/tools/meteor_npm.js:85:14)
at _.extend.installNpmDependencies (/home/travis/.meteor/tools/cc18dfef9e/tools/packages.js:317:17)
at _.extend._maybeUpdateNpmDependencies (/home/travis/.meteor/tools/cc18dfef9e/tools/bundler.js:422:13)
at _.extend.includeTests (/home/travis/.meteor/tools/cc18dfef9e/tools/bundler.js:484:10)
at exports.bundle (/home/travis/.meteor/tools/cc18dfef9e/tools/bundler.js:878:16)
at Array.forEach (native)
at Function._.each._.forEach (/home/travis/.meteor/tools/cc18dfef9e/lib/node_modules/underscore/underscore.js:78:11)
at Object.exports.bundle (/home/travis/.meteor/tools/cc18dfef9e/tools/bundler.js:877:9)
at /home/travis/.meteor/tools/cc18dfef9e/tools/run.js:697:26
at exports.inFiber (/home/travis/.meteor/tools/cc18dfef9e/tools/fiber-helpers.js:24:12)
- - - - -
npm http 200 https://github.com/peerlibrary/pdf.js/tarball/d48097845fa4fb4e00fe895d0412872535ad0730

npm ERR! cb() never called!
npm ERR! not ok code 0

at ChildProcess.exithandler (child_process.js:540:15)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:638:16)
at Process._handle.onexit (child_process.js:680:5)

mitar commented Jun 28, 2013

There are some tickets existing about that:


mitar commented Jun 28, 2013

Used version on Travis CI:

$ node --version
$ npm --version

mitar commented Jun 28, 2013

It happens randomly. Sometimes it works. I suspect that setting in travis.yml node.js version to:

  - "0.8"

would solve the problem.


mitar commented Jun 28, 2013

Setting lower version doesn't help because npm is still similar version:

$ node --version
$ npm --version

timhaines commented Aug 19, 2013

I've seen this over the last 24 hours a couple of times too, when bundling.

=> Running Meteor from a checkout -- overrides project version (0.6.5)

js-analyze: updating npm dependencies -- esprima, estraverse, escope...
npm WARN package.json packages-for-meteor-smartpackage-js-analyze@0.0.0 No repository field.
npm WARN package.json packages-for-meteor-smartpackage-js-analyze@0.0.0 No readme data.
npm http GET https://registry.npmjs.org/estraverse/1.1.2-1
npm http GET https://github.com/ariya/esprima/tarball/5044b87f94fb802d9609f1426c838874ec2007b3
npm http GET https://github.com/meteor/escope/tarball/fef31f03797be5718080f811f9ca6e5297c90d2a
npm http 200 https://registry.npmjs.org/estraverse/1.1.2-1
npm http GET https://registry.npmjs.org/estraverse/-/estraverse-1.1.2-1.tgz
npm http 200 https://registry.npmjs.org/estraverse/-/estraverse-1.1.2-1.tgz
npm http 200 https://github.com/ariya/esprima/tarball/5044b87f94fb802d9609f1426c838874ec2007b3
npm http 200 https://github.com/meteor/escope/tarball/fef31f03797be5718080f811f9ca6e5297c90d2a
npm ERR! cb() never called!
npm ERR! not ok code 0

TypeError: Cannot read property 'JSAnalyze' of undefined
at _.extend.build (/home/deploy/.meteorite/meteors/meteor/meteor/b6a67875e6ebcf4ad55fac6e3bbb65003994a1f8/tools/packages.js:465:23)

I just got this too (although I'm running on ARM, so there be dragons). It really seems to be an npm issue, although since Meteor isn't on node 0.10 I'm not sure it'll be fixed on the npm side.

There's actually an npm package whose sole purpose is avoiding this bug: https://npmjs.org/package/npm-install-retry

If you get desperate, you could try replacing all the instances of npm install with the retry, and see if that works.

dfearon commented Sep 25, 2013

Just to mention that I had this problem with NPM version 1.3.11, and solved it simply by re-running the exact same command multiple times ("npm update -g"). The error popped up for a different package on each subsequent run and eventually everything updated successfully.

In my case at least, it seems like it was being caused by a network issue (corrupted downloads). I was also getting an error about an invalid package, which I was able to resolve by deleting all instances of "tmp.tgz".


mitar commented Sep 25, 2013

@dfearon: I know you can just rerun. But this does not really help me with CI tests on Travis CI. It means my tests fail and this really is not nice. So yes, for me it fails on really big npm packages we are using, so download takes some time. It would be useful to be able to specify timeout. And as well it would be useful if the error message would be something more clear. Other people who were using our install scripts didn't know that it is just an Internet issue. If it would be written "Download timeout" or something it would be better.

dfearon commented Sep 26, 2013

No problem, just mentioning it in case it helps anyone or helps to identify the cause. I could be wrong about it being a networking issue, it had just appeared to fit with it being seemingly random and with the "tmp.tgz is not a valid package" problem occurring around the same time.


mitar commented Sep 26, 2013

I also believe it is a network issue. Not necessary that the network is not working, but already if the network is slow and the package is large.


n1mmy commented Sep 27, 2013

This appears to be fixed by upgrading to Node 0.10, now on devel.

I ran a loop creating a clean checkout of meteor and installing all the npm modules. I didn't see this error in over 1000 invocations of npm install.

@n1mmy n1mmy closed this Sep 27, 2013

@h2non h2non referenced this issue in AdesisNetlife/grunt-pug-i18n Sep 16, 2014


Tasks directory not found #16


timhaines commented Jan 24, 2015

@n1mmy I'm see this again today. Have node v0.10.33 installed.

Also getting this error. I tried npm cache clean. I deleted the node_modules, etc. Out of 10 builds, npm install worked 2 times. This is happening on both my dev and build machine.

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Projects\MyApp\node_modules\grunt-styleguide\
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
Build failed
npm ERR! cb() never called!

npm --v is 1.7.4
node --v is 0.12.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment