Skip to content
This repository has been archived by the owner. It is now read-only.

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

Closed
sorccu opened this issue Jun 3, 2014 · 10 comments
Labels
Milestone

Comments

@sorccu
Copy link

@sorccu 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?

@smikes
Copy link
Contributor

@smikes smikes commented Nov 13, 2014

Possibly the same issue as #6679.

@smikes
Copy link
Contributor

@smikes smikes commented Nov 15, 2014

also #6533

@jonbretman
Copy link

@jonbretman jonbretman commented Nov 17, 2014

+1 on this issue.

@iarna
Copy link
Contributor

@iarna iarna commented Mar 27, 2015

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

@smikes
Copy link
Contributor

@smikes 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?

@iarna
Copy link
Contributor

@iarna 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. 😜

@iarna
Copy link
Contributor

@iarna iarna commented Apr 2, 2015

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

@smikes
Copy link
Contributor

@smikes smikes commented Apr 2, 2015

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

@othiym23
Copy link
Contributor

@othiym23 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 added a commit to openstf/stf that referenced this issue Jul 1, 2015
@cdaringe
Copy link

@cdaringe cdaringe commented Oct 14, 2015

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.