Skip to content

How do you verify npm is compiled against iojs #426

@Raynos

Description

@Raynos

cc @rvagg @othiym23

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

> [email protected] 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

> [email protected] 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions