我想在我的Debian 8 VPS上运行rocketchat(一个nodejs应用程序)。此VPS在OpenVZ上运行,因此内核版本为2.6.32-042stab108.8。 如nodejs网站上描述的那样安装NodeJS(他们自己的repo,而不是debian提供的那个)工作没有问题。
然而,当我跑
时npm install
NPM无法安装所需的软件包并打印以下内容:
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN package.json meteor-dev-bundle@0.0.0 No license field.
\
> fibers@1.0.5 install /home/rocketchat/rchat/programs/server/node_modules/fibers
> node ./build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/home/rocketchat/rchat/programs/server/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc: In function 'v8::Handle<v8::Signature> uni::NewSignature(v8::Isolate*, v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)':
../src/fibers.cc:132:54: error: no matching function for call to 'v8::Signature::New(v8::Isolate*&, v8::Handle<v8::FunctionTemplate>&, int&, v8::Handle<v8::FunctionTemplate>*&)'
return Signature::New(isolate, receiver, argc, argv);
^
../src/fibers.cc:132:54: note: candidate is:
In file included from /home/rocketchat/.node-gyp/4.4.2/include/node/node.h:42:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/rocketchat/.node-gyp/4.4.2/include/node/v8.h:4675:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)
static Local<Signature> New(
^
/home/rocketchat/.node-gyp/4.4.2/include/node/v8.h:4675:27: note: candidate expects 2 arguments, 4 provided
../src/fibers.cc: In function 'void uni::SetResourceConstraints(v8::Isolate*, v8::ResourceConstraints*)':
../src/fibers.cc:140:3: error: 'SetResourceConstraints' is not a member of 'v8'
v8::SetResourceConstraints(isolate, constraints);
^
../src/fibers.cc:140:3: note: suggested alternative:
../src/fibers.cc:139:7: note: 'uni::SetResourceConstraints'
void SetResourceConstraints(Isolate* isolate, ResourceConstraints* constraints) {
^
../src/fibers.cc: In function 'v8::Handle<v8::Signature> uni::NewSignature(v8::Isolate*, v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)':
../src/fibers.cc:133:2: warning: control reaches end of non-void function [-Wreturn-type]
}
^
fibers.target.mk:97: recipe for target 'Release/obj.target/fibers/src/fibers.o' failed
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
make: Leaving directory '/home/rocketchat/rchat/programs/server/node_modules/fibers/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: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-042stab108.8
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/rocketchat/rchat/programs/server/node_modules/fibers
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Build failed
npm ERR! Linux 2.6.32-042stab108.8
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--build-from-source"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! fibers@1.0.5 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers@1.0.5 install script 'node ./build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fibers
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/rocketchat/rchat/programs/server/npm-debug.log
是否因为内核太旧而发生?特殊类型的虚拟化使nodejs无法使用似乎很奇怪。
编辑:包含完整的npm安装输出
Edit2:编译器版本是gcc-4.9,g ++ - 4.9
答案 0 :(得分:3)
我明白了。
首先,不,OpenVZ所需的内核版本与此无关。
这里发生了什么。我尝试安装的nodeJS应用程序(Rocket.Chat)是使用Meteor框架构建的。显然,Meteor only works on NodeJS v0.10.40。对于v4和v5,Debian 8存储库只有v4.4.2和v0.10.29,nodejs网站has instructions。
如果您遇到此问题,我的建议是通过node version manager安装节点v0.10.40。完成后,npm install将按照宣传的方式工作。