Repository navigation
How do you verify npm is compiled against iojs #426
Description
TL:DR;
- How do I determine which version of iojs my npm binary is compiled against
- How do I determine whether binary modules fail because they dont support iojs or I compiled them against node instead of iojs
I compiled iojs from source. This created a iojs compatible binary at /usr/local/bin/npm version
I try to verify that my new npm is compiled against iojs with
raynos at raynos-MacBookPro ~/projects
$ /usr/local/bin/npm version
{ npm: '2.2.0',
ares: '1.9.0-DEV',
http_parser: '1.0',
modules: '11',
node: '0.10.26',
openssl: '1.0.1e',
uv: '0.10.25',
v8: '3.14.5.9',
zlib: '1.2.3' }
raynos at raynos-MacBookPro ~/projects
$ 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.28' }
As you can see the only difference is the version of npm, I know my local npm on PATH is compiled against node 0.10
How do I know whether npm install or npm rebuild in my application will actually recompile my modules against iojs.
There is nothing in the npm rebuild output that tells me information
> v8-profiler@5.2.2 install /home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build
[v8-profiler] Success: "/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/build/profiler/v5.2.2/node-v11-linux-x64/profiler.node" already installed
Pass --build-from-source to recompile
> farmhash@0.0.3 install /home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash
> node-gyp rebuild
make: Entering directory `/home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash/build'
CXX(target) Release/obj.target/farmhash/src/upstream/farmhash.o
CXX(target) Release/obj.target/farmhash/src/farmhash.o
SOLINK_MODULE(target) Release/obj.target/farmhash.node
SOLINK_MODULE(target) Release/obj.target/farmhash.node: Finished
COPY Release/farmhash.node
make: Leaving directory `/home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash/build'
When I run my application it fails. I presume its because v8-profiler doesnt support iojs but I cant tell from the output
$ iojs server/server.js
module.js:324
throw err;
^
Error: Cannot find module '/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/build/profiler/v5.2.2/node-v42-linux-x64/profiler.node'
at Function.Module._resolveFilename (module.js:322:15)
at Function.Module._load (module.js:264:25)
at Module.require (module.js:351:17)
at require (module.js:370:17)
at Object.<anonymous> (/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/v8-profiler.js:4:15)
at Module._compile (module.js:446:26)
at Object.Module._extensions..js (module.js:464:10)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
at Module.require (module.js:351:17)
It'd be great if we had a way of knowing what the state of my binary dependencies are. i.e. which version of v8 are they compiled against. Which version of node.h or iojs.h
Activity
mscdex commentedon Jan 14, 2015
Currently the
process.versions.nodeshould be updated. So it should show1.0.0or1.0.1.Raynos commentedon Jan 15, 2015
@mscdex that's only for the
iojsbinary. I want to figure out how to use thenpmbinary in some fashion to figure out whether its linked againtsnode 0.10oriojs 1.0.2othiym23 commentedon Jan 20, 2015
There's definitely nothing specific that npm itself does. Remember that it doesn't even build the binaries, but instead hands that responsibility off to
node-gypduring the package build / rebuild step. If you want to futz around withnm/ldd/otool, you can probably figure out which libraries were used to build a given binary, but a more explicit denotation would certainly be handy. Maybe open an issue onnode-gyp, or see if any of the discussion on nodejs/node-gyp#564 gives you any ideas.Fishrock123 commentedon Jan 30, 2015
seems like a node-gyp thing? re-open if it isn't. :)