npm 错误, sos
发布于 9 年前 作者 thomas0836 5876 次浏览 最后一次编辑是 8 年前 来自 问答

屏幕快照 2015-10-22 下午9.55.51.png

之前在版主推荐的解决方案 https://github.com/nodejs/node-gyp/issues/154 https://github.com/nodejs/node-gyp#installation

已经 npm i 了 node-gyp , python 也配置好了2.7的 可是项目 依然 install 的时候 出现这个问题

9 回复

也有可能是VC++没安装。 node-gyp只是起一个判断是什么程序编译, 编译程序的功能!

◦Windows 7/8: Microsoft Visual Studio C++ 2013 for Windows Desktop (Express version works well)

@thomas0836 你是linux??? 就要安装GCC ◦A proper C/C++ compiler toolchain, like GCC

@orbury 是linux 的,其实我想请教一下,您是从上面哪些信息看到需要安装GCC的?貌似没有类似的字眼呢?还是说只是经验的判断

@orbury

$ yum -y install gcc Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile Package gcc-4.4.7-16.el6.x86_64 already installed and latest version Nothing to do $ yum -y install gcc-c++ Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile Package gcc-c+±4.4.7-16.el6.x86_64 already installed and latest version Nothing to do $ npm install
bcrypt@0.8.5 install /home/cfunWeb/node_modules/bcrypt node-gyp rebuild make: Entering directory /home/cfunWeb/node_modules/bcrypt/build' CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o In file included from /root/.node-gyp/4.2.1/include/node/node.h:42, from ../node_modules/nan/nan.h:24, from ../src/bcrypt_node.cc:1: /root/.node-gyp/4.2.1/include/node/v8.h:336: error: expected unqualified-id before ‘using’ /root/.node-gyp/4.2.1/include/node/v8.h: In constructor ‘v8::MaybeLocal<T>::MaybeLocal()’: /root/.node-gyp/4.2.1/include/node/v8.h:353: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::IsEmpty() const’: /root/.node-gyp/4.2.1/include/node/v8.h:360: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const’: /root/.node-gyp/4.2.1/include/node/v8.h:364: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘bool v8::WeakCallbackInfo<T>::IsFirstPass() const’: /root/.node-gyp/4.2.1/include/node/v8.h:430: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: At global scope: /root/.node-gyp/4.2.1/include/node/v8.h:469: error: expected unqualified-id before ‘using’ /root/.node-gyp/4.2.1/include/node/v8.h: In constructor ‘v8::Global<T>::Global()’: /root/.node-gyp/4.2.1/include/node/v8.h:790: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In constructor ‘v8::Global<T>::Global(v8::Global<T>&&)’: /root/.node-gyp/4.2.1/include/node/v8.h:815: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘v8::Global<T>& v8::Global<T>::operator=(v8::Global<S>&&)’: /root/.node-gyp/4.2.1/include/node/v8.h:827: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: At global scope: /root/.node-gyp/4.2.1/include/node/v8.h:852: error: expected unqualified-id before ‘using’ /root/.node-gyp/4.2.1/include/node/v8.h:1089: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h:1095: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’: /root/.node-gyp/4.2.1/include/node/v8.h:3205: error: ‘nullptr’ was not declared in this scope /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’: /root/.node-gyp/4.2.1/include/node/v8.h:7164: error: ‘nullptr’ was not declared in this scope In file included from ../node_modules/nan/nan.h:184, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_maybe_43_inl.h: At global scope: ../node_modules/nan/nan_maybe_43_inl.h:13: error: expected unqualified-id before ‘using’ ../node_modules/nan/nan_maybe_43_inl.h:16: error: expected unqualified-id before ‘using’ ../node_modules/nan/nan_maybe_43_inl.h:19: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:24: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:31: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:36: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:41: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:46: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:51: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:60: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:65: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:70: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:77: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:84: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:92: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:99: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:109: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:115: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:119: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:126: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:131: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:136: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:140: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:146: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:151: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:157: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:163: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:169: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:175: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:181: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:187: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:195: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:202: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:206: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:210: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:214: error: expected initializer before ‘<’ token ../node_modules/nan/nan_maybe_43_inl.h:218: error: expected initializer before ‘<’ token In file included from ../node_modules/nan/nan.h:189, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_converters.h:14: error: ISO C++ forbids declaration of ‘MaybeLocal’ with no type ../node_modules/nan/nan_converters.h:14: error: expected ‘;’ before ‘<’ token ../node_modules/nan/nan_converters.h:16: error: ISO C++ forbids declaration of ‘Maybe’ with no type ../node_modules/nan/nan_converters.h:16: error: expected ‘;’ before ‘<’ token ../node_modules/nan/nan_converters.h:26: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:27: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:28: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:29: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:30: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:31: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:32: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:42: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:43: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:44: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:45: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:46: error: ‘return_t’ does not name a type In file included from ../node_modules/nan/nan_converters.h:59, from ../node_modules/nan/nan.h:189, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_converters_43_inl.h:18: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Boolean>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:19: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Number>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:20: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::String>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:21: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Object>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:22: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Integer>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:23: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Uint32>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:24: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Int32>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:34: error: ‘return_t’ in class ‘Nan::imp::ToFactory<bool>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:35: error: ‘return_t’ in class ‘Nan::imp::ToFactory<double>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:36: error: ‘return_t’ in class ‘Nan::imp::ToFactory<long int>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:37: error: ‘return_t’ in class ‘Nan::imp::ToFactory<unsigned int>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:38: error: ‘return_t’ in class ‘Nan::imp::ToFactory<int>’ does not name a type In file included from ../node_modules/nan/nan.h:190, from ../src/bcrypt_node.cc: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: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../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: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../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: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../node_modules/nan/nan_new.h: At global scope: ../node_modules/nan/nan_new.h:43: error: ISO C++ forbids declaration of ‘MaybeLocal’ with no type ../node_modules/nan/nan_new.h:43: error: expected ‘;’ before ‘<’ token ../node_modules/nan/nan_new.h:75: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:141: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:147: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:148: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:160: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:161: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:162: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:163: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:165: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:166: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:182: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:183: error: ‘return_t’ does not name a type In file included from ../node_modules/nan/nan_new.h:189, from ../node_modules/nan/nan.h:190, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_implementation_12_inl.h:56: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::Date>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:209: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::RegExp>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:228: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::Script>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:234: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::Script>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:266: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:274: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:280: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:287: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:293: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:298: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:359: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::UnboundScript>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:366: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::UnboundScript>’ does not name a type In file included from ../node_modules/nan/nan.h:190, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_new.h:291: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:297: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:303: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:309: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:315: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:321: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:327: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::RegExp>’ does not name a type In file included from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’: ../node_modules/nan/nan.h:641: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowError(const char*)’: ../node_modules/nan/nan.h:641: error: ‘class v8::Local<v8::Boolean>’ 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:642: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowRangeError(const char*)’: ../node_modules/nan/nan.h:642: error: ‘class v8::Local<v8::Boolean>’ 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:643: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowReferenceError(const char*)’: ../node_modules/nan/nan.h:643: error: ‘class v8::Local<v8::Boolean>’ 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:644: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowSyntaxError(const char*)’: ../node_modules/nan/nan.h:644: error: ‘class v8::Local<v8::Boolean>’ 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:645: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowTypeError(const char*)’: ../node_modules/nan/nan.h:645: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: At global scope: ../node_modules/nan/nan.h:653: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:675: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:691: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:704: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:721: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:727: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:735: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:742: error: expected initializer before ‘<’ token ../node_modules/nan/nan.h:748: error: expected initializer before ‘<’ token /root/.node-gyp/4.2.1/include/node/v8.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local<v8::Function>&)’: /root/.node-gyp/4.2.1/include/node/v8.h:3021: error: argument dependent lookup finds ‘class v8::Set’ ../node_modules/nan/nan.h:1368: error: in call to ‘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:1490: error: ‘class v8::Local<v8::Boolean>’ 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:1508: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In member function ‘virtual void Nan::AsyncWorker::HandleErrorCallback()’: ../node_modules/nan/nan.h:1542: error: no matching function for call to ‘New(const char*)’ ../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(const T&, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’: ../node_modules/nan/nan.h:1832: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate>, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’: ../node_modules/nan/nan.h:1845: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ In file included from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan.h: In function ‘void Nan::Export(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’: ../node_modules/nan/nan.h:2116: error: no matching function for call to ‘New(const char*&)’ /root/.node-gyp/4.2.1/include/node/v8.h:3021: error: argument dependent lookup finds ‘class v8::Set’ ../node_modules/nan/nan.h:2117: error: in call to ‘Set’ ../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’: ../node_modules/nan/nan.h:2124: error: no matching function for call to ‘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:2137: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In member function ‘void Nan::Tap::pass(const char*)’: ../node_modules/nan/nan.h:2143: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’ make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1 make: Leaving directory/home/cfunWeb/node_modules/bcrypt/build’ gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/root/n/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 2.6.32-431.11.15.el6.ucloud.x86_64 gyp ERR! command “/root/n/bin/node” “/root/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild" gyp ERR! cwd /home/cfunWeb/node_modules/bcrypt gyp ERR! node -v v4.2.1 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm ERR! Linux 2.6.32-431.11.15.el6.ucloud.x86_64 npm ERR! argv “/root/n/bin/node” “/root/n/bin/npm” "install" npm ERR! node v4.2.1 npm ERR! npm v2.14.7 npm ERR! code ELIFECYCLE npm ERR! bcrypt@0.8.5 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@0.8.5 install script ‘node-gyp rebuild’. npm ERR! This is most likely a problem with the bcrypt 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 bcrypt npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/cfunWeb/npm-debug.log

呃。。。看过好多 build 出问题的帖子,不过好像也没有什么很万能的解决方式。 这错误日志我也是不太看得懂啊…

@thomas0836 node-gyp的主页。

@alsotang 我大致说说情况吧!希望大神们看看是哪里的问题。 我现在是在ucloud 的CentOS 6.5 64位的系统,使用root登陆后 通过wget的方式下载最新版本的git。 然后 通过curl -L http://git.io/n-install | bash 来安装 n ,安装n后会自动下载 安装了最新的node 4.2.1 。 然后 安装npm i -g node-gyp。 再下载python2.7 运行npm config set python /path/to/executable/python2.7 (path/to/executable 部分已换成本地的)。 再在git上下载自己的项目(该项目以在aws上的服务器在运行的了,现在是因为国外服务器访问速度有点慢想换成国内的试试)。 再然后是安装mongodb,和redies,然后进项目运行make,make是参考cnode论坛那个开源项目写的(在aws已验证可以运行的)。 再然后就是上面的错误了,接着 按照@orbury 的提议再yum -y install gcc-c++ 问题依然……

在aws当时是 按照普通的流程来安装node,没有使用n来管理,那时还没有升级到4.2 ,已经部署好在运行,之后为了升级 npm i -g n 然后用n来升级node 再在配置文件修改了node 的运行路径到n的版本管理路径下。

我……是需要重装一遍 不先安装n来试试吗!?

回到顶部