在Raspberry pi中安装节点js的usb检测模块时出错

时间:2016-03-10 14:06:00

标签: node.js raspberry-pi

大家好我在覆盆子pi中安装usb-detection,但是当我运行尊重cmd时        “npm install usb-detection”下面出现错误     usb-detection@1.3.0 install / home / pi / node_modules / usb-detection

  

node-gyp rebuild

make: Entering directory '/home/pi/node_modules/usb-detection/build'
  CXX(target) Release/obj.target/detection/src/detection.o
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h:41:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from /home/pi/.node-gyp/4.2.1/include/node/node.h:42:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/pi/.node-gyp/4.2.1/include/node/v8.h:336:1: error: expected unqualified-id before ‘using’
/home/pi/.node-gyp/4.2.1/include/node/v8.h:469:1: error: expected unqualified-id before ‘using’
/home/pi/.node-gyp/4.2.1/include/node/v8.h:852:1: error: expected unqualified-id before ‘using’
In file included from ../node_modules/nan/nan.h:194:0,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_maybe_43_inl.h:13:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:16:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:19:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:24:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:31:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:36:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:41:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:46:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:51:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:59:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:64:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:69:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:76:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:83:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:91:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:98:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:108:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:114:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:118:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:125:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:130:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:135:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:139:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:145:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:150:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:156:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:162:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:168:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:174:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:180:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:186:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:194:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:201:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:205:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:209:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:213:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:217:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:223:12: error: ‘MaybeLocal’ does not name a type
In file included from ../node_modules/nan/nan.h:199:0,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_converters.h:14:11: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_converters.h:16:56: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_converters.h:26:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:27:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:28:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:29:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:30:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:31:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:32:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:42:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:43:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:44:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:45:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:46:1: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_converters.h:59:0,
                 from ../node_modules/nan/nan.h:199,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_converters_43_inl.h:18:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Boolean>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:19:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Number>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:20:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::String>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:21:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Object>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:22:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Integer>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:23:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Uint32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:24:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Int32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:34:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<bool>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:35:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<double>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:36:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<long long int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:37:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<unsigned int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:38:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<int>’ does not name a type
In file included from ../node_modules/nan/nan.h:200:0,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Integer]’:
../node_modules/nan/nan_new.h:21:32: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:21:32: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Int32]’:
../node_modules/nan/nan_new.h:28:30: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:28:30: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Uint32]’:
../node_modules/nan/nan_new.h:35:31: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:35:31: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: At global scope:
../node_modules/nan/nan_new.h:43:11: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_new.h:75:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:141:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:147:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:148:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:160:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:161:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:162:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:163:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:165:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:166:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:182:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:183:17: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:200,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_implementation_12_inl.h:56:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Date>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:90:46: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::FunctionTemplate>::return_t Nan::imp::Factory<v8::FunctionTemplate>::New(Nan::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>)’:
../node_modules/nan/nan_implementation_12_inl.h:118:48: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: At global scope:
../node_modules/nan/nan_implementation_12_inl.h:197:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:216:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:222:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:254:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:262:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:268:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:275:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:281:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:286:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:347:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:354:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type
In file included from ../node_modules/nan/nan.h:200:0,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_new.h:293:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:299:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:305:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:311:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:317:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:323:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:329:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:335:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’:
../node_modules/nan/nan.h:659:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowError(const char*)’:
../node_modules/nan/nan.h:659:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::RangeError(const char*)’:
../node_modules/nan/nan.h:660:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowRangeError(const char*)’:
../node_modules/nan/nan.h:660:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::ReferenceError(const char*)’:
../node_modules/nan/nan.h:661:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowReferenceError(const char*)’:
../node_modules/nan/nan.h:661:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::SyntaxError(const char*)’:
../node_modules/nan/nan.h:662:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowSyntaxError(const char*)’:
../node_modules/nan/nan.h:662:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::TypeError(const char*)’:
../node_modules/nan/nan.h:663:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowTypeError(const char*)’:
../node_modules/nan/nan.h:663:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:671:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:693:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:709:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:722:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:739:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:745:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:753:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:760:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:766:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local<v8::Function>&)’:
../node_modules/nan/nan.h:1402:40: error: ‘Set’ was not declared in this scope
../node_modules/nan/nan.h:1402:40: note: suggested alternative:
/home/pi/.node-gyp/4.2.1/include/node/v8.h:3021:17: note:   ‘v8::Set’
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1524:41: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’:
../node_modules/nan/nan.h:1542:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘virtual void Nan::AsyncWorker::HandleErrorCallback()’:
../node_modules/nan/nan.h:1576:58: error: no matching function for call to ‘New(const char*)’
../node_modules/nan/nan.h:1576:58: note: candidates are:
../node_modules/nan/nan_implementation_12_inl.h:390:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&)
../node_modules/nan/nan_implementation_12_inl.h:395:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&)
../node_modules/nan/nan_implementation_12_inl.h:400:21: note: template<class T> v8::Local<T> Nan::New(const Nan::Global<T>&)
../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New()
../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0)
../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1)
../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2)
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(const T&, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:1865:16: error: there are no arguments to ‘GetFunction’ that depend on a template parameter, so a declaration of ‘GetFunction’ must be available [-fpermissive]
../node_modules/nan/nan.h:1865:16: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../node_modules/nan/nan.h:1866:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate>, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:1878:32: error: ‘GetFunction’ was not declared in this scope
../node_modules/nan/nan.h:1879:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:1904:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1947:51: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::PropertyGetterCallback, Nan::PropertySetterCallback, Nan::PropertyQueryCallback, Nan::PropertyDeleterCallback, Nan::PropertyEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1995:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::IndexGetterCallback, Nan::IndexSetterCallback, Nan::IndexQueryCallback, Nan::IndexDeleterCallback, Nan::IndexEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2065:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetCallHandler(v8::Local<v8::FunctionTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2120:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetCallAsFunctionHandler(v8::Local<v8::ObjectTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2142:47: error: ‘NewInstance’ was not declared in this scope
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In function ‘void Nan::Export(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:2169:35: error: no matching function for call to ‘New(const char*&)’
../node_modules/nan/nan.h:2169:35: note: candidates are:
../node_modules/nan/nan_implementation_12_inl.h:390:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&)
../node_modules/nan/nan_implementation_12_inl.h:395:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&)
../node_modules/nan/nan_implementation_12_inl.h:400:21: note: template<class T> v8::Local<T> Nan::New(const Nan::Global<T>&)
../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New()
../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0)
../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1)
../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2)
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../node_modules/nan/nan.h:2170:47: error: ‘GetFunction’ was not declared in this scope
../node_modules/nan/nan.h:2170:65: error: ‘Set’ was not declared in this scope
../node_modules/nan/nan.h:2170:65: note: suggested alternative:
/home/pi/.node-gyp/4.2.1/include/node/v8.h:3021:17: note:   ‘v8::Set’
../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2177:30: error: no matching function for call to ‘To(v8::Local<v8::Value>&)’
../node_modules/nan/nan.h:2177:30: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan.h: In member function ‘void Nan::Tap::ok(bool, const char*)’:
../node_modules/nan/nan.h:2190:33: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘void Nan::Tap::pass(const char*)’:
../node_modules/nan/nan.h:2196:30: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:2220:10: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:2225:40: error: ‘MaybeLocal’ was not declared in this scope
../node_modules/nan/nan.h:2225:40: note: suggested alternative:
/home/pi/.node-gyp/4.2.1/include/node/v8.h:111:7: note:   ‘v8::MaybeLocal’
../node_modules/nan/nan.h:2225:52: error: template argument 1 is invalid
../node_modules/nan/nan.h:2225:54: error: expected unqualified-id before ‘>’ token
../node_modules/nan/nan.h:2234:1: error: ‘MaybeLocal’ does not name a type
../src/detection.cpp:211:17: error: variable or field ‘init’ declared void
../src/detection.cpp:211:13: error: ‘Handle’ is not a member of ‘v8’
../src/detection.cpp:211:34: error: expected primary-expression before ‘>’ token
../src/detection.cpp:211:36: error: ‘target’ was not declared in this scope
../src/detection.cpp:221:1: error: ‘init’ was not declared in this scope
detection.target.mk:90: recipe for target 'Release/obj.target/detection/src/detection.o' failed
make: *** [Release/obj.target/detection/src/detection.o] Error 1
make: Leaving directory '/home/pi/node_modules/usb-detection/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 3.18.7-v7+
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/pi/node_modules/usb-detection
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 3.18.7-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "usb-detection"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! usb-detection@1.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usb-detection@1.3.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the usb-detection 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 usb-detection
npm ERR! There is likely additional logging output above.

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

1 个答案:

答案 0 :(得分:0)

看起来你需要另一个c ++编译器。 我想这会对你有所帮助:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --config gcc (choose gcc-5 from the list)