简体   繁体   English

在Centos 6.7上安装僵尸4.2.1时出现NPM错误

[英]NPM erros when installing zombie 4.2.1 on Centos 6.7

I'm running a vagrant bento/centos-6.7 box. 我正在运行一个无聊的 bento/centos-6.7盒子。 My node version is v6.9.1 and my npm version is 3.10.8 . 我的节点版本是v6.9.1 ,我的npm版本是3.10.8 When I run npm install zombie@4.2 I get the following error: 当我运行npm install zombie@4.2 ,出现以下错误:

node-gyp rebuild

make: Entering directory `/home/vagrant/zombie-test/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from ../src/bufferutil.cc:7:

/* stack trace */

make: Leaving directory `/home/vagrant/zombie-test/node_modules/bufferutil/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: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.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vagrant/zombie-test/node_modules/bufferutil
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

Full stack trace here 完整的堆栈跟踪在这里

Both node and npm were installed using this instructions : 节点和npm均使用以下说明安装:

$ curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
$ yum -y install nodejs

Any known solutions for this error? 有任何已知的解决方案来解决此错误吗?

You'll need a newer gcc/g++ version (the one that ships with CentOS6 is way too old). 您将需要更新的gcc / g ++版本(CentOS6附带的版本太旧了)。 Take a look at this: http://linux.web.cern.ch/linux/devtoolset/ - where you can update the building tools to decent/recent versions. 看一下这一点: http : //linux.web.cern.ch/linux/devtoolset/-您可以在其中将构建工具更新为最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM