Hello everyone!
My system is centOS 6.6
Nodejs: 6.10.3
gcc: gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
When i run npm install, it throws below exception. Please tell my how to fix it?
> [email protected] install /u01/projects/GimoAnphaStation/MSamCard/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory `/u01/projects/GimoAnphaStation/MSamCard/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 ../src/bcrypt_node.cc:1:
../../nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from /home/binh.vo/.node-gyp/6.10.3/include/node/node.h:42,
from ../../nan/nan.h:47,
from ../src/bcrypt_node.cc:1:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:345: error: expected unqualified-id before ‘using’
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In constructor ‘v8::MaybeLocal<T>::MaybeLocal()’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:362: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::IsEmpty() const’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:369: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:373: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘bool v8::WeakCallbackInfo<T>::IsFirstPass() const’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:441: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: At global scope:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:481: error: expected unqualified-id before ‘using’
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global()’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:820: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global(v8::Global<T>&&)’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:845: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘v8::Global<T>& v8::Global<T>::operator=(v8::Global<S>&&)’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:857: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: At global scope:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:882: error: expected unqualified-id before ‘using’
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:1119: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:1125: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:3278: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: At global scope:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:4498: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:4514: error: ‘nullptr’ was not declared in this scope
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’:
/home/binh.vo/.node-gyp/6.10.3/include/node/v8.h:7538: error: ‘nullptr’ was not declared in this scope
In file included from ../../nan/nan.h:190,
from ../src/bcrypt_node.cc:1:
../../nan/nan_maybe_43_inl.h: At global scope:
../../nan/nan_maybe_43_inl.h:13: error: expected unqualified-id before ‘using’
../../nan/nan_maybe_43_inl.h:16: error: expected unqualified-id before ‘using’
../../nan/nan_maybe_43_inl.h:19: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:24: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:31: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:36: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:41: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:46: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:51: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:59: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:64: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:69: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:76: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:83: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:91: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:98: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:108: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:114: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:118: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:125: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:130: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:135: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:139: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:145: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:150: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:156: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:162: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:168: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:174: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:180: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:186: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:194: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:201: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:205: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:209: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:213: error: expected initializer before ‘<’ token
../../nan/nan_maybe_43_inl.h:217: error: expected initializer before ‘<’ token
../src/bcrypt_node.cc:353: error: expected ‘}’ at end of input
../../nan/nan_callbacks_12_inl.h:167: warning: ‘void Nan::imp::FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:181: warning: ‘void Nan::imp::GetterCallbackWrapper(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:197: warning: ‘void Nan::imp::SetterCallbackWrapper(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:253: warning: ‘void Nan::imp::PropertyGetterCallbackWrapper(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:270: warning: ‘void Nan::imp::PropertySetterCallbackWrapper(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:290: warning: ‘void Nan::imp::PropertyEnumeratorCallbackWrapper(const v8::PropertyCallbackInfo<v8::Array>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:306: warning: ‘void Nan::imp::PropertyDeleterCallbackWrapper(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:323: warning: ‘void Nan::imp::PropertyQueryCallbackWrapper(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:428: warning: ‘void Nan::imp::IndexGetterCallbackWrapper(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:444: warning: ‘void Nan::imp::IndexSetterCallbackWrapper(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:464: warning: ‘void Nan::imp::IndexEnumeratorCallbackWrapper(const v8::PropertyCallbackInfo<v8::Array>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:480: warning: ‘void Nan::imp::IndexDeleterCallbackWrapper(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&)’ defined but not used
../../nan/nan_callbacks_12_inl.h:496: warning: ‘void Nan::imp::IndexQueryCallbackWrapper(uint32_t, const v8::PropertyCallbackInfo<v8::Integer>&)’ defined but not used
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory `/u01/projects/GimoAnphaStation/MSamCard/node_modules/bcrypt/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: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:215:12)
gyp ERR! System Linux 2.6.32-573.22.1.el6.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 /u01/projects/GimoAnphaStation/MSamCard/node_modules/bcrypt
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 2.6.32-573.22.1.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.10.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 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 information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, 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! /u01/projects/GimoAnphaStation/MSamCard/npm-debug.log
[@refack edited formating]
@hiiphop I'm not a CentOS expert but IMHO the key is This version of node/NAN/v8 requires a C++11 compiler
See the discussion at https://github.com/nodejs/nan/issues/500
I think the minimum supported gcc level is 4.8. Not sure if that's documented anywhere.
Not sure if that's documented anywhere.
I was looking for a documented reference. Probably the only one is at https://github.com/nodejs/node/blob/master/BUILDING.md#supported-platforms-1
@refack I was try with devtoolset 2.0 on centOS but i don't know how to configure gcc path and python 2.7. Can you tell me?
@gibfahn I think so. But on centOS 6.6, default version of gcc is 4.4
I'm pretty sure you can do something like:
export PYTHON=/path/to/python2.7
export CC=/path/to/gcc
export CXX=/path/to/g++
in general though I think node-gyp picks up the cc and c++ in the path, which are usually symlinks to gcc and g++ (@bnoordhuis will correct me if I'm wrong).
That should work but with devtoolset it's easier to scl enable devtoolset-2 bash and then run node-gyp from inside that bash shell.
@bnoordhuis It's very helpful. Thank you so much. It worked for me.
Thank you everyone.! Love u guys
Most helpful comment
That should work but with devtoolset it's easier to
scl enable devtoolset-2 bashand then run node-gyp from inside that bash shell.