-
Notifications
You must be signed in to change notification settings - Fork 3k
Specific combination of dependencies causes npm install to skip building native modules #5400
Description
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
> [email protected] 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
[email protected] node_modules/zmq
├── [email protected]
└── [email protected]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
[email protected] node_modules/zmq
├── [email protected]
└── [email protected]
[email protected] node_modules/chai
├── [email protected]
└── [email protected] ([email protected])
[email protected] node_modules/sinon
├── [email protected] ([email protected])
└── [email protected] ([email protected])
[email protected] node_modules/sinon-chaiAny 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
> [email protected] 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
[email protected] node_modules/chai
├── [email protected]
└── [email protected] ([email protected])
[email protected] node_modules/sinon
├── [email protected] ([email protected])
└── [email protected] ([email protected])
[email protected] node_modules/zmq
├── [email protected]
└── [email protected]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?