Skip to content
This repository

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

Closed
mitar opened this Issue · 11 comments

5 participants

Mitar Tim Haines Ted Blackman dfearon Nick Martin
Mitar
mitar commented

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
mitar commented

There are some tickets existing about that:

Mitar
mitar commented

Used version on Travis CI:

$ node --version
v0.10.12
$ npm --version
1.2.32
Mitar
mitar commented

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

node_js:
  - "0.8"

would solve the problem.

Mitar
mitar commented

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

$ node --version
v0.8.22
$ npm --version
1.2.14
Tim Haines

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

/home/deploy/.meteorite/meteors/meteor/meteor/b6a67875e6ebcf4ad55fac6e3bbb65003994a1f8/dev_bundle/lib/node_modules/fibers/future.js:173
throw(ex);
^
TypeError: Cannot read property 'JSAnalyze' of undefined
at _.extend.build (/home/deploy/.meteorite/meteors/meteor/meteor/b6a67875e6ebcf4ad55fac6e3bbb65003994a1f8/tools/packages.js:465:23)

Ted Blackman

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

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

@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

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

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.

Mitar mitar referenced this issue in arunoda/travis-ci-meteor-packages
Merged

Adding --once argument to test-packages command #7

Nick Martin
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.