1

我想在我的 Debian 8 VPS 上运行 Rocketchat(一个 nodejs 应用程序)。这个VPS运行在OpenVZ上,所以内核版本是2.6.32-042stab108.8。按照 nodejs 网站(他们自己的仓库,而不是 debian 提供的仓库)上的描述安装 NodeJS 没有问题。

但是,当我跑步时

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 install 输出

Edit2:编译器版本为 gcc-4.9、g++-4.9

4

1 回答 1

3

我想到了。

首先,不——OpenVZ 所需的内核版本与此无关。

这就是发生的事情。我尝试安装的 nodeJS 应用程序(Rocket.Chat)是使用 Meteor 框架构建的。显然,Meteor 仅适用于 NodeJS v0.10.40。Debian 8 存储库只有 v4.4.2 和 v0.10.29,nodejs 网站v4 和 v5 的说明。

如果你遇到这个问题,我的建议是通过node version manager安装 node v0.10.40 。完成后, npm install 将按照宣传的方式工作。

于 2016-04-07T21:46:37.487 回答