Specific combination of dependencies causes npm install to skip building native modules #5400

Closed
sorccu opened this Issue Jun 3, 2014 · 10 comments

Comments

Projects
None yet
7 participants

sorccu commented Jun 3, 2014

This bug is so weird that it's even a bit difficult to describe, so I'll illustrate with an example. Basically what happens is that a certain combination of modules prevents native modules from being built. The modules in question are zmq and sinon-chai.

(Note that you'll have to brew install zeromq before running the examples)

Example. This works like it should, and produces zmq.node:

test  npm install zmq

> zmq@2.7.0 install /private/tmp/test/node_modules/zmq
> node-gyp rebuild

  CXX(target) Release/obj.target/zmq/binding.o
  SOLINK_MODULE(target) Release/zmq.node
ld: warning: directory not found for option '-L/opt/local/lib'
  SOLINK_MODULE(target) Release/zmq.node: Finished
zmq@2.7.0 node_modules/zmq
├── bindings@1.1.1
└── nan@0.8.0

However, if I also install sinon-chai at the same time, zmq.node will not get built: (rm -rf node_modules before running):

test  npm install zmq sinon-chai
zmq@2.7.0 node_modules/zmq
├── bindings@1.1.1
└── nan@0.8.0

chai@1.9.1 node_modules/chai
├── assertion-error@1.0.0
└── deep-eql@0.1.3 (type-detect@0.1.1)

sinon@1.10.2 node_modules/sinon
├── util@0.10.3 (inherits@2.0.1)
└── formatio@1.0.2 (samsam@1.1.1)

sinon-chai@2.5.0 node_modules/sinon-chai

Any other combination works. For example, installing sinon and chai (the dependencies of sinon-chai) with zmq works like it should:

test  npm install zmq sinon chai

> zmq@2.7.0 install /private/tmp/test/node_modules/zmq
> node-gyp rebuild

  CXX(target) Release/obj.target/zmq/binding.o
  SOLINK_MODULE(target) Release/zmq.node
ld: warning: directory not found for option '-L/opt/local/lib'
  SOLINK_MODULE(target) Release/zmq.node: Finished
chai@1.9.1 node_modules/chai
├── assertion-error@1.0.0
└── deep-eql@0.1.3 (type-detect@0.1.1)

sinon@1.10.2 node_modules/sinon
├── util@0.10.3 (inherits@2.0.1)
└── formatio@1.0.2 (samsam@1.1.1)

zmq@2.7.0 node_modules/zmq
├── bindings@1.1.1
└── nan@0.8.0

This is the only failing combination I have managed to find (and in an actual app using package.json, too).

The problem occurs on every machine we have tried so far, including my developer machine (version information below) and a production build server running node v0.10.28 with the default NPM.

test  npm version
{ http_parser: '1.0',
  node: '0.10.26',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.25',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1e',
  npm: '1.4.13' }

Any ideas?

faiq added the tickler label Jun 3, 2014

othiym23 added this to the multi-stage install milestone Jul 23, 2014

@othiym23 othiym23 added bug and removed tickler labels Jul 23, 2014

Contributor

smikes commented Nov 13, 2014

Possibly the same issue as #6679.

Contributor

smikes commented Nov 15, 2014

also #6533

+1 on this issue.

@briangough briangough added a commit to sharelatex/sharelatex that referenced this issue Nov 24, 2014

@briangough briangough force an npm rebuild to work around issue #129, missing bcrypt bindin…
…gs file

see npm/npm#5400
4d3d43f

@iarna iarna added next-major ready needs-tests and removed ready labels Dec 15, 2014

Owner

iarna commented Mar 27, 2015

That is totally freaky. Also fixed npm/npm#multi-stage, so I'm closing the issue now.

iarna closed this Mar 27, 2015

Contributor

smikes commented Apr 2, 2015

@iarna, sorry if I'm being dense, but where is the commit that fixed this?

Can you take a look at #7074 to see if it's the same class of problem?

Owner

iarna commented Apr 2, 2015

@smikes: All the code relating to it was rewritten, so you won't find a specific commit. The fix in multi-stage was to change everything. 😜

Owner

iarna commented Apr 2, 2015

And yes, I'm pretty sure this is the same as 7074, FWIW.

Contributor

smikes commented Apr 2, 2015

Ahh.. you took off and nuked the site from orbit. Nice.

Contributor

othiym23 commented Apr 3, 2015

I'm pretty sure that this has the same underlying cause as #7074, and so should be fixed in npm@2.7.6, coming shortly. Install it tomorrow and see if it does indeed address this bug?

@sorccu sorccu added a commit to openstf/stf that referenced this issue Jul 1, 2015

@sorccu sorccu Attempt to work around npm/npm#5400. 18cf96a

I experienced similar symptoms on 2.11.3 installing leveldown, despite that npm component being revamped. bummer! however, installing 3.3.6 and installing thru it resolved my issue

sorccu referenced this issue in openstf/stf Jan 13, 2016

Closed

stf local error #250

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