2017-10-12 29 views
0

npmを使用してnodejsにraw-socket [1.2.6]モジュールをインストールしようとしました。モジュールをインストールしようとすると、次のエラーが発生します。npm 3.10.10を使用して[email protected]をインストールできない

Node version : 6.11.3 

NPM version : 3.10.10 

[[email protected] node_modules]$ npm install raw-socket2 

> [email protected] install /home/test/node_modules/raw-socket2 
> node-gyp rebuild 

make: Entering directory `/home/test/node_modules/raw-socket2/build' 
    CXX(target) Release/obj.target/raw/src/raw.o 
In file included from /home/test/.node-gyp/6.11.3/include/node/node.h:42, 
     from ../../nan/nan.h:24, 
     from ../src/raw.cc:4: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:345: error: expected unqualified-id before ‘using’ 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::MaybeLocal<T>::MaybeLocal()’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:362: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::IsEmpty() const’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:369: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:373: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::WeakCallbackInfo<T>::IsFirstPass() const’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:441: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:481: error: expected unqualified-id before ‘using’ 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global()’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:820: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global(v8::Global<T>&&)’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:845: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::Global<T>& v8::Global<T>::operator=(v8::Global<S>&&)’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:857: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:882: error: expected unqualified-id before ‘using’ 
/home/test/.node-gyp/6.11.3/include/node/v8.h:1119: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h:1125: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:3279: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:4499: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h:4515: error: ‘nullptr’ was not declared in this scope 
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’: 
/home/test/.node-gyp/6.11.3/include/node/v8.h:7544: error: ‘nullptr’ was not declared in this scope 
In file included from ../../nan/nan.h:111, 
     from ../src/raw.cc:4: 
../../nan/nan_new.h: At global scope: 
../../nan/nan_new.h:24: error: template declaration of ‘v8::Local<T> Nan::imp::To’ 
../../nan/nan_new.h:24: error: ‘Handle’ is not a member of ‘v8’ 
../../nan/nan_new.h:24: error: expected primary-expression before ‘>’ token 
../../nan/nan_new.h:24: error: ‘i’ was not declared in this scope 
../../nan/nan_new.h:29: error: expected initializer before ‘<’ token 
../../nan/nan_new.h:34: error: expected initializer before ‘<’ token 
../../nan/nan_new.h:39: error: expected initializer before ‘<’ token 
../../nan/nan_new.h:66: error: ‘v8::Handle’ has not been declared 
../../nan/nan_new.h:66: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_new.h:65: error: default argument missing for parameter 2 of ‘static v8::Local<v8::Context> Nan::imp::Factory<v8::Context>::New(v8::ExtensionConfiguration*, int)’ 
../../nan/nan_new.h:85: error: ‘v8::Handle’ has not been declared 
../../nan/nan_new.h:85: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_new.h:93: error: ‘v8::Handle’ has not been declared 
../../nan/nan_new.h:93: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_new.h:92: error: default argument missing for parameter 2 of ‘static v8::Local<v8::FunctionTemplate> Nan::imp::Factory<v8::FunctionTemplate>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’ 
../../nan/nan_new.h:139: error: ‘v8::Handle’ has not been declared 
../../nan/nan_new.h:139: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_new.h:151: error: ISO C++ forbids declaration of ‘Handle’ with no type 
../../nan/nan_new.h:151: error: typedef name may not be a nested-name-specifier 
../../nan/nan_new.h:151: error: expected ‘;’ before ‘<’ token 
../../nan/nan_new.h:152: error: ‘FTH’ has not been declared 
../../nan/nan_new.h:152: error: ‘FTH’ was not declared in this scope 
../../nan/nan_new.h:171: error: ‘v8::Handle’ has not been declared 
../../nan/nan_new.h:171: error: expected ‘,’ or ‘...’ before ‘<’ token 
In file included from ../../nan/nan_new.h:191, 
     from ../../nan/nan.h:111, 
     from ../src/raw.cc:4: 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::BooleanObject> Nan::imp::Factory<v8::BooleanObject>::New(bool)’: 
../../nan/nan_implementation_12_inl.h:49: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:4009) 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:56: error: ‘v8::Handle’ has not been declared 
../../nan/nan_implementation_12_inl.h:56: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Context> Nan::imp::Factory<v8::Context>::New(v8::ExtensionConfiguration*, int)’: 
../../nan/nan_implementation_12_inl.h:58: error: ‘tmpl’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:58: error: ‘obj’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:79: error: ‘v8::Handle’ has not been declared 
../../nan/nan_implementation_12_inl.h:79: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Function> Nan::imp::Factory<v8::Function>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’: 
../../nan/nan_implementation_12_inl.h:82: error: ‘data’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:89: error: ‘v8::Handle’ has not been declared 
../../nan/nan_implementation_12_inl.h:89: error: expected ‘,’ or ‘...’ before ‘<’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::FunctionTemplate> Nan::imp::Factory<v8::FunctionTemplate>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’: 
../../nan/nan_implementation_12_inl.h:93: error: ‘data’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:94: error: ‘signature’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h: In static member function ‘static typename Nan::imp::IntegerFactory<T>::return_t Nan::imp::IntegerFactory<T>::New(int32_t)’: 
../../nan/nan_implementation_12_inl.h:117: error: ‘To’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:117: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static typename Nan::imp::IntegerFactory<T>::return_t Nan::imp::IntegerFactory<T>::New(uint32_t)’: 
../../nan/nan_implementation_12_inl.h:123: error: ‘To’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:123: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Uint32> Nan::imp::Factory<v8::Uint32>::New(int32_t)’: 
../../nan/nan_implementation_12_inl.h:128: error: ‘To’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:128: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Uint32> Nan::imp::Factory<v8::Uint32>::New(uint32_t)’: 
../../nan/nan_implementation_12_inl.h:134: error: ‘To’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:134: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:156: error: ‘v8::Local<v8::RegExp> Nan::imp::Factory<v8::RegExp>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::RegExp>’ 
../../nan/nan_implementation_12_inl.h:156: error: ‘Handle’ is not a member of ‘v8’ 
../../nan/nan_implementation_12_inl.h:156: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h:156: error: ‘pattern’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:157: error: expected primary-expression before ‘flags’ 
../../nan/nan_implementation_12_inl.h:157: error: expected ‘,’ or ‘;’ before ‘{’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Script> Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>)’: 
../../nan/nan_implementation_12_inl.h:166: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1352) 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Script> Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’: 
../../nan/nan_implementation_12_inl.h:173: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1352) 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:179: error: ‘v8::Local<v8::Signature> Nan::imp::Factory<v8::Signature>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::Signature>’ 
../../nan/nan_implementation_12_inl.h:179: error: ‘FTH’ is not a member of ‘Nan::imp::Factory<v8::Signature>’ 
../../nan/nan_implementation_12_inl.h:179: error: expected ‘,’ or ‘;’ before ‘{’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::String> Nan::imp::Factory<v8::String>::New(const uint8_t*, int)’: 
../../nan/nan_implementation_12_inl.h:206: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:2332) 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::String> Nan::imp::Factory<v8::String>::New(v8::String::ExternalStringResource*)’: 
../../nan/nan_implementation_12_inl.h:217: warning: ‘static v8::Local<v8::String> v8::String::NewExternal(v8::Isolate*, v8::String::ExternalStringResource*)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:2371) 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:228: error: ‘v8::Local<v8::StringObject> Nan::imp::Factory<v8::StringObject>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::StringObject>’ 
../../nan/nan_implementation_12_inl.h:228: error: ‘Handle’ is not a member of ‘v8’ 
../../nan/nan_implementation_12_inl.h:228: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h:228: error: ‘value’ was not declared in this scope 
../../nan/nan_implementation_12_inl.h:228: error: expected ‘,’ or ‘;’ before ‘{’ token 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::UnboundScript> Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>)’: 
../../nan/nan_implementation_12_inl.h:237: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1333) 
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::UnboundScript> Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’: 
../../nan/nan_implementation_12_inl.h:244: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1333) 
../../nan/nan_implementation_12_inl.h: At global scope: 
../../nan/nan_implementation_12_inl.h:253: error: ‘NanNew’ declared as an ‘inline’ variable 
../../nan/nan_implementation_12_inl.h:253: error: template declaration of ‘v8::Local<T> NanNew’ 
../../nan/nan_implementation_12_inl.h:253: error: ‘Handle’ is not a member of ‘v8’ 
../../nan/nan_implementation_12_inl.h:253: error: expected primary-expression before ‘>’ token 
../../nan/nan_implementation_12_inl.h:253: error: ‘h’ was not declared in this scope 
    . 
    . 
    . 
../../nan/nan.h:2112: error: expected ‘,’ or ‘;’ before ‘{’ token 
../../nan/nan.h:2109: warning: ‘_NanGetExternalParts’ defined but not used 




make: *** [Release/obj.target/raw/src/raw.o] Error 1 
make: Leaving directory `/home/test/node_modules/raw-socket2/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:276:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit 
(internal/child_process.js:219:12) 
gyp ERR! System Linux 2.6.32-642.el6.x86_64 
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /home/test/node_module`enter code here`s/raw-socket2 
gyp ERR! node -v v6.11.3 
gyp ERR! node-gyp -v v3.4.0 
gyp ERR! not ok 
npm WARN [email protected] No repository field. 
npm WARN [email protected] license should be a valid SPDX license expression 
npm ERR! Linux 2.6.32-642.el6.x86_64 
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "raw-socket2" 
npm ERR! node v6.11.3 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the raw-socket2 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 information on how to open an issue for this project with: 
npm ERR!  npm bugs raw-socket2 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls raw-socket2 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /home/test/node_modules/npm-debug.log 

異なるバージョンのnodejで同じことを試みました。しかし、バージョン0.10.36でうまく動作します。

答えて

0

raw-socketをインストールしていない場合は、raw-socket2をインストールしていますが、これは前者のフォークですが、維持管理があまり進んでいないため、より新しいバージョンのNode.jsにはインストールされません)。

オリジナルのraw-socketはノード8でも問題なく動作しているようです(ただし、コンパイラはインストール時にさまざまな警告を発しますが、警告はエラーではありません)。

+0

生のソケットをインストールしている間....我々は、NPM生のソケットをインストールし、次のエラーを取得 > [email protected]インストール/ホーム/テスト/ node_modules /生ソケット >ノード-GYPを再構築します make:ディレクトリ '/ home/test/node_modules/raw-socket/build 'を入力してください。 CXX(ターゲット)リリース/ obj.target/raw/src/raw.o ../src/rawからファイルに含まれています。 h:23、 from ../src/raw.cc:6: ../node_modules/nan/nan.h:43:3:エラー:#errorこのノード/ NAN/v8バージョンでは、C++が必要です11コンパイラ ファイル内に/home/test/.node-gyp/6.11.3/include –

+0

_ "...にはC++ 11コンパイラが必要です" _。それであなたは1つをインストールしましたか? – robertklep

関連する問題