brianc / node-pg-native

Native (C/C++) bindings to PostgreSQL with sync and async options.
247 stars 44 forks source link

Failed install using iojs v3.0.0 #23

Closed iscekic closed 9 years ago

iscekic commented 9 years ago
> node-gyp rebuild

make: Entering directory '/home/igor/Projects/pg-native-test/node_modules/pg-native/node_modules/libpq/build'
  CXX(target) Release/obj.target/addon/src/connection.o
In file included from ../src/addon.h:5:0,
                 from ../src/connection.cc:1:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) 
                           ^
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../src/addon.h:5,
                 from ../src/connection.cc:1:
/home/igor/.node-gyp/3.0.0/include/node/node_buffer.h:35:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Handle<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/igor/.node-gyp/3.0.0/include/node/node_buffer.h:35:40: note:   conversion of argument 3 would be ill-formed:
In file included from ../src/addon.h:5:0,
                 from ../src/connection.cc:1:
../node_modules/nan/nan.h:768:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../src/addon.h:5,
                 from ../src/connection.cc:1:
/home/igor/.node-gyp/3.0.0/include/node/node_buffer.h:47:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/igor/.node-gyp/3.0.0/include/node/node_buffer.h:47:40: note:   conversion of argument 2 would be ill-formed:
In file included from ../src/addon.h:5:0,
                 from ../src/connection.cc:1:
../node_modules/nan/nan.h:768:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../src/connection.cc: In member function ‘void Connection::Emit(const char*)’:
../src/connection.cc:920:28: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
     node::FatalException(tc);
                            ^
In file included from ../src/addon.h:4:0,
                 from ../src/connection.cc:1:
/home/igor/.node-gyp/3.0.0/include/node/node.h:283:29: note: declared here
                 inline void FatalException(const v8::TryCatch& try_catch) {
                             ^
/home/igor/.node-gyp/3.0.0/include/node/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^
addon.target.mk:94: recipe for target 'Release/obj.target/addon/src/connection.o' failed
make: *** [Release/obj.target/addon/src/connection.o] Error 1
make: Leaving directory '/home/igor/Projects/pg-native-test/node_modules/pg-native/node_modules/libpq/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
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 Linux 4.1.4-1-ARCH
gyp ERR! command "/usr/bin/iojs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/igor/Projects/pg-native-test/node_modules/pg-native/node_modules/libpq
gyp ERR! node -v v3.0.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 
npm ERR! Linux 4.1.4-1-ARCH
npm ERR! argv "/usr/bin/iojs" "/usr/bin/npm" "install" "pg-native"
npm ERR! node v3.0.0
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE
further npm stuff...
ruimarinho commented 9 years ago

You need to wait for the release of libpq with support for iojs 3.0.0 or, alternatively, bump the dependency manually on your project's package.json, like so:

"libpq": "git+ssh://git@github.com/kkoopa/node-libpq#nan2",

This will make pg-native compatible with the latest iojs for now.

iscekic commented 9 years ago

Thanks!