当我在这个例子中尝试安装像Hiredis这样的模块时,我遇到了一些v8错误。当安装需要node-gyp重建时,这种类型的错误出现在其他模块安装上
我在Fedora上:和
- nodeJS v5.0.0
- node-gyp v0.10.6
- npm v3.3.6
npm install hiredis --save
> hiredis@0.2.0 install /home/thoms/Bureau/App/node_modules/livedb/node_modules/hiredis
> node-gyp rebuild
make: Entering directory '/home/thoms/Bureau/App/node_modules/livedb/node_modules/hiredis/build'
CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o
CC(target) Release/obj.target/hiredis/deps/hiredis/net.o
CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o
CC(target) Release/obj.target/hiredis/deps/hiredis/async.o
CC(target) Release/obj.target/hiredis/deps/hiredis/read.o
AR(target) Release/obj.target/deps/hiredis.a
COPY Release/hiredis.a
CXX(target) Release/obj.target/hiredis/src/hiredis.o
In file included from ../../nan/nan_new.h:181:0,
from ../../nan/nan.h:74,
from ../src/reader.h:4,
from ../src/hiredis.cc:3:
../../nan/nan_implementation_12_inl.h: Dans la fonction membre statique ‘static NanIntern::FactoryBase<v8::Signature>::return_t NanIntern::Factory<v8::Signature>::New(NanIntern::Factory<v8::Signature>::FTH, int, NanIntern::Factory<v8::Signature>::FTH*)’:
../../nan/nan_implementation_12_inl.h:172:76: erreur: no matching function for call to ‘v8::Signature::New(v8::Isolate*, NanIntern::Factory<v8::Signature>::FTH&, int&, NanIntern::Factory<v8::Signature>::FTH*&)’
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
^
In file included from ../src/hiredis.cc:1:0:
/home/thoms/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: candidate: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)
static Local<Signature> New(
^
/home/thoms/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: candidate expects 2 arguments, 4 provided
In file included from ../src/reader.h:4:0,
from ../src/hiredis.cc:3:
../../nan/nan.h: At global scope:
../../nan/nan.h:165:25: erreur: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
../../nan/nan.h:160:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
^
../../nan/nan.h:500:13: erreur: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../../nan/nan.h:500:35: erreur: expected ‘,’ or ‘...’ before ‘callback’
, node::smalloc::FreeCallback callback
^
../../nan/nan.h: Dans la fonction ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:504:50: erreur: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h:504:60: erreur: ‘hint’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h: Dans la fonction ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:511:67: erreur: 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 ../../nan/nan.h:25:0,
from ../src/reader.h:4,
from ../src/hiredis.cc:3:
/home/thoms/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/home/thoms/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: conversion of argument 3 would be ill-formed:
In file included from ../src/reader.h:4:0,
from ../src/hiredis.cc:3:
../../nan/nan.h:511:67: erreur: 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 ../../nan/nan.h:25:0,
from ../src/reader.h:4,
from ../src/hiredis.cc:3:
/home/thoms/.node-gyp/5.0.0/include/node/node_buffer.h:43: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/thoms/.node-gyp/5.0.0/include/node/node_buffer.h:43:40: note: conversion of argument 2 would be ill-formed:
In file included from ../src/reader.h:4:0,
from ../src/hiredis.cc:3:
../../nan/nan.h:511:67: erreur: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
../../nan/nan.h: Dans la fonction ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:515:29: erreur: 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);
^
../../nan/nan.h: Dans la fonction ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:522:12: erreur: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
hiredis.target.mk:102: recipe for target 'Release/obj.target/hiredis/src/hiredis.o' failed
make: *** [Release/obj.target/hiredis/src/hiredis.o] Error 1
make: Leaving directory '/home/thoms/Bureau/App/node_modules/livedb/node_modules/hiredis/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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.2.5-300.fc23.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/thoms/Bureau/App/node_modules/livedb/node_modules/hiredis
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:hiredis hiredis@0.2.0 install: `node-gyp rebuild`
npm WARN install:hiredis Exit status 1
> hiredis@0.4.1 install /home/thoms/Bureau/App/node_modules/hiredis
> node-gyp rebuild
make: Entering directory '/home/thoms/Bureau/App/node_modules/hiredis/build'
CC(target) Release/obj.target/hiredis-c/deps/hiredis/sds.o
CC(target) Release/obj.target/hiredis-c/deps/hiredis/read.o
AR(target) Release/obj.target/deps/hiredis-c.a
COPY Release/hiredis-c.a
CXX(target) Release/obj.target/hiredis/src/hiredis.o
CXX(target) Release/obj.target/hiredis/src/reader.o
SOLINK_MODULE(target) Release/obj.target/hiredis.node
COPY Release/hiredis.node
make: Leaving directory '/home/thoms/Bureau/App/node_modules/hiredis/build'
unnamed@0.0.0 /home/thoms/Bureau/App
└── hiredis@0.4.1