nodejs 从0.12 升级到5.或者4 版本,一些库无法安装问题
本来用的0.12.7 版本,现在发现官方已经升级到了4.2.4 和 5.3.0 , 升级到4.或者 5的版本之后,发现原来使用的一些库无法安装,主要是ccap和ursa,主要记录如下: 1、
../node_modules/nan/nan.h:1939: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void
../node_modules/nan/nan.h:2162: error: ‘GetFunction’ was not declared in this scope
/usr/local/node-v4.2.4-linux-x64/lib/node_modules/ursa/.node-gyp/4.2.4/include/node/v8.h:3021: error: argument dependent lookup finds ‘class v8::Set’
../node_modules/nan/nan.h:2162: error: in call to ‘Set’
../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2169: error: no matching function for call to ‘To(v8::Local<v8::Value>&)’
../node_modules/nan/nan.h:2212: error: ISO C++ forbids declaration of ‘MaybeLocal’ with no type
../node_modules/nan/nan.h:2212: error: expected ‘;’ before ‘<’ token
../src/ursaNative.cc:344: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
gyp ERR! build error
2、
/usr/local/node-v4.2.4-linux-x64/lib/node_modules/ccap/.node-gyp/4.2.4/include/node/v8.h:3205: error: ‘nullptr’ was not declared in this scope
/usr/local/node-v4.2.4-linux-x64/lib/node_modules/ccap/.node-gyp/4.2.4/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’:
/usr/local/node-v4.2.4-linux-x64/lib/node_modules/ccap/.node-gyp/4.2.4/include/node/v8.h:7164: error: ‘nullptr’ was not declared in this scope
make: *** [Release/obj.target/hcaptha/addon/hcaptha.o] Error 1
make: Leaving directory `/usr/local/node-v4.2.4-linux-x64/lib/node_modules/ccap/build'
gyp ERR! build error
2 回复
下载了源代码,编译,没想到,make 没有通过。。。
g++ -pthread -rdynamic -m64 -fuse-ld=gold -B/usr/src/node-v4.2.4/third_party/binutils/Linux_x64/Release/bin -m64 -o /usr/src/node-v4.2.4/out/Release/mksnapshot -Wl,--start-group /usr/src/node-v4.2.4/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /usr/src/node-v4.2.4/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /usr/src/node-v4.2.4/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a /usr/src/node-v4.2.4/out/Release/obj.target/deps/v8/tools/gyp/libv8_libplatform.a /usr/src/node-v4.2.4/out/Release/obj.target/deps/v8/tools/gyp/libv8_libbase.a -Wl,--end-group -ldl -lrt
collect2: fatal error: cannot find 'ld'
compilation terminated.
make[1]: *** [/usr/src/node-v4.2.4/out/Release/mksnapshot] Error 1
make[1]: Leaving directory `/usr/src/node-v4.2.4/out'
make: *** [node] Error 2