bnoordhuis / node-buffertools

working with node.js buffers made easy
ISC License
205 stars 35 forks source link

buffertoools@2.0.1 fails to install on openSUSE 13.1 #55

Closed maialithar closed 10 years ago

maialithar commented 10 years ago

Unfortunatelly, it fails to install with npm:

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 3.11.6-4-desktop
gyp ERR! command "node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/buffertools
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! buffertools@2.0.1 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the buffertools@2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools 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 buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.6-4-desktop
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "buffertools"
npm ERR! cwd /usr/lib/node_modules
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/lib/node_modules/npm-debug.log
npm ERR! not ok code 0

Some additional info:

npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools
In file included from /usr/include/node/node.h:67:0,
                 from ../buffertools.cc:17:
/usr/include/node/node_object_wrap.h: In destructor ‘virtual node::ObjectWrap::~ObjectWrap()’:
/usr/include/node/node_object_wrap.h:51:14: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >’
       handle_->SetPointerInInternalField(0, 0);
              ^
/usr/include/node/node_object_wrap.h: In static member function ‘static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>)’:
/usr/include/node/node_object_wrap.h:62:36: error: ‘class v8::Object’ has no member named ‘GetPointerFromInternalField’
     return static_cast<T*>(handle->GetPointerFromInternalField(0));
                                    ^
/usr/include/node/node_object_wrap.h: In member function ‘void node::ObjectWrap::Wrap(v8::Handle<v8::Object>)’:
/usr/include/node/node_object_wrap.h:72:53: error: no matching function for call to ‘v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >::New(v8::Handle<v8::Object>&)’
     handle_ = v8::Persistent<v8::Object>::New(handle);
                                                     ^
/usr/include/node/node_object_wrap.h:72:53: note: candidate is:
In file included from /usr/include/node/node.h:62:0,
                 from ../buffertools.cc:17:
/usr/include/v8.h:5591:4: note: static T* v8::Persistent<T, M>::New(v8::Isolate*, T*) [with T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]
 T* Persistent<T, M>::New(Isolate* isolate, T* that) {
    ^
/usr/include/v8.h:5591:4: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/node/node.h:67:0,
...

libv8-3 is installed on my system along with v8-devel and v8-private-headers-devel. What else is required?

maialithar commented 10 years ago

Additional info: when I install it manually it seems to work fine:

my_machine:/usr/lib/node_modules # git clone https://github.com/bnoordhuis/node-buffertools.git buffertools
Cloning into 'buffertools'...
remote: Reusing existing pack: 311, done.
remote: Total 311 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (311/311), 62.97 KiB | 0 bytes/s, done.
Resolving deltas: 100% (163/163), done.
Checking connectivity... done
my_machine:/usr/lib/node_modules # cd buffertools/
my_machine:/usr/lib/node_modules/buffertools # node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.13.0
gyp info using node@0.10.5 | linux | x64
gyp info spawn python
gyp info spawn args [ '/usr/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   '/usr/lib/node_modules/buffertools/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/0.10.5/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/0.10.5',
gyp info spawn args   '-Dmodule_root_dir=/usr/lib/node_modules/buffertools',
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' ]
make: Entering directory `/usr/lib/node_modules/buffertools/build'
  CXX(target) Release/obj.target/buffertools/buffertools.o
  SOLINK_MODULE(target) Release/obj.target/buffertools.node
  SOLINK_MODULE(target) Release/obj.target/buffertools.node: Finished
  COPY Release/buffertools.node
make: Leaving directory `/usr/lib/node_modules/buffertools/build'
gyp info ok
bnoordhuis commented 10 years ago

Is that a fedora system? The system v8 (and by extension, its headers) is too new to work with V8 3.14, the V8 that ships with node.js v0.10. I speculate that npm install -g picks up the system headers whereas node-gyp rebuild doesn't.

maialithar commented 10 years ago

It's openSUSE 13.1. My libv8-3 is at version 3.22.24.8. Any chance to get it working? Or do I have to wait for node update?

bnoordhuis commented 10 years ago

If there are no other packages that depend on libv8, then it's easiest to uninstall it. You don't need it for node because V8 is statically linked into the binary.

maialithar commented 10 years ago

buffertools won't even try to install without v8:

webaplikacje:~ # zypper remove libv8-3 v8-devel
...
(1/2) Removing v8-devel-3.22.24.8-2.4.1 [done]
(2/2) Removing libv8-3-3.22.24.8-2.4.1 [done]
my_machine:~ # npm -g install buffertools
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools

> buffertools@2.0.1 install /usr/lib/node_modules/buffertools
> node-gyp rebuild

make: Entering directory `/usr/lib/node_modules/buffertools/build'
  CXX(target) Release/obj.target/buffertools/buffertools.o
In file included from ../buffertools.cc:17:0:
/usr/include/node/node.h:62:16: fatal error: v8.h: No such file or directory
 #include "v8.h"
                ^
compilation terminated.
make: *** [Release/obj.target/buffertools/buffertools.o] Error 1
make: Leaving directory `/usr/lib/node_modules/buffertools/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 3.11.6-4-desktop
gyp ERR! command "node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/buffertools
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! buffertools@2.0.1 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the buffertools@2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools 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 buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.6-4-desktop
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "buffertools"
npm ERR! cwd /root
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0
my_machine:~ #
bnoordhuis commented 10 years ago

I suspect something's off with your install. Can you try rm -fr $HOME/.node-gyp/ followed by a rebuild? If that doesn't work, maybe try as non-root.

By the way, you should consider upgrading to the latest v0.10. There have been a number of critical bugs fixed since v0.10.5.

maialithar commented 10 years ago

Upgrading node helped, thanks. The latest possible version I have in my repo is v0.10.17. Thanks for your help!