brianc / node-libpq

Simple, low level native bindings to PostgreSQL's libpq from node.js
112 stars 42 forks source link

Added latest node release into build matrix #33

Closed nkt closed 8 years ago

nkt commented 9 years ago

:cry:

brianc commented 9 years ago

Thanks @nkt taking a look now

brianc commented 9 years ago

I'm having an issue with node-gyp. If I manually install node-gyp with npm i --global node-gyp and run node-gyp rebuild in the project directory it works fine & all tests pass, but when I run npm install in the project directory it invokes an older version of node-gyp and the build fails:

$ npm i
-
> libpq@1.7.0 install /Users/brianc/src/node-libpq
> node-gyp rebuild

gyp: /Users/brianc/.node-gyp/4.0.0/common.gypi not found (cwd: /Users/brianc/src/node-libpq) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/brianc/local/node@v4.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:357:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/Users/brianc/local/node@v4.0.0/bin/node" "/Users/brianc/local/node@v4.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/brianc/src/node-libpq
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/brianc/local/node@v4.0.0/bin/node" "/Users/brianc/local/node/bin/npm" "i"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! libpq@1.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libpq@1.7.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libpq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls libpq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/brianc/src/node-libpq/npm-debug.log

here's with the newer version of node-gyp installed:

09:08:55 ~/src/node-libpq (master)
$ npm i --global node-gyp
/Users/brianc/local/node@v4.0.0/bin/node-gyp -> /Users/brianc/local/node@v4.0.0/lib/node_modules/node-gyp/bin/node-gyp.js
node-gyp@3.0.1 /Users/brianc/local/node@v4.0.0/lib/node_modules/node-gyp
├── graceful-fs@4.1.2
├── semver@5.0.1
├── osenv@0.1.3 (os-tmpdir@1.0.1, os-homedir@1.0.1)
├── fstream@1.0.8 (inherits@2.0.1)
├── nopt@3.0.4 (abbrev@1.0.7)
├── which@1.1.2 (is-absolute@0.1.7)
├── minimatch@1.0.0 (sigmund@1.0.1, lru-cache@2.6.5)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── tar@1.0.3 (inherits@2.0.1, block-stream@0.0.8)
├── path-array@1.0.0 (array-index@0.1.1)
├── glob@4.5.3 (inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.10)
├── rimraf@2.4.3 (glob@5.0.14)
├── npmlog@1.2.1 (ansi@0.3.0, are-we-there-yet@1.0.4, gauge@1.2.2)
└── request@2.61.0 (aws-sign2@0.5.0, forever-agent@0.6.1, stringstream@0.0.4, caseless@0.11.0, oauth-sign@0.8.0, tunnel-agent@0.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, node-uuid@1.4.3, qs@4.0.0, combined-stream@1.0.5, form-data@1.0.0-rc3, mime-types@2.1.6, http-signature@0.11.0, bl@1.0.0, tough-cookie@2.0.0, hawk@3.1.0, har-validator@1.8.0)

09:09:04 ~/src/node-libpq (master)
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.0.1
gyp info using node@4.0.0 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/brianc/local/node@v4.0.0/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brianc/src/node-libpq/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brianc/local/node@v4.0.0/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brianc/.node-gyp/4.0.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/brianc/.node-gyp/4.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/brianc/local/node@v4.0.0/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/brianc/src/node-libpq',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/addon/src/connection.o
  CXX(target) Release/obj.target/addon/src/connect-async-worker.o
  CXX(target) Release/obj.target/addon/src/addon.o
  SOLINK_MODULE(target) Release/addon.node
gyp info ok

Any ideas? I'm stumped & don't have a lot of time to work on this right now.

nkt commented 9 years ago

https://github.com/Homebrew/homebrew/pull/43714#issuecomment-139462250 Short answer is: npm not support node 4.0 today.

brianc commented 8 years ago

Thanks for doing this! Bad news is there's a merge conflict but the good news is I added this and it's passing now! :dancer: thanks for your help and patience.