安装nodebb依赖项时出错

时间:2014-08-14 08:15:05

标签: node.js npm

我尝试从these instructions安装nodebb,但是当我运行npm install

时出现一系列错误
npm install
npm ERR! fetch failed https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/nodebb-widget-essentials/-/nodebb-widget-essentials-0.1.0-5.tgz
npm ERR! fetch failed https://registry.npmjs.org/nodebb-theme-lavender/-/nodebb-theme-lavender-0.0.77.tgz
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.30","npm":"1.4.21"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.30","npm":"1.4.21"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.30","npm":"1.4.21"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.30","npm":"1.4.21"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.30","npm":"1.4.21"})

> hiredis@0.1.17 install /home/andy/dev/nodebb/node_modules/reds/node_modules/redis/node_modules/hiredis
> node-gyp rebuild

make: Entering directory `/home/andy/dev/nodebb/node_modules/reds/node_modules/redis/node_modules/hiredis/build'
  CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/net.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/async.o
  AR(target) Release/obj.target/deps/hiredis.a
  COPY Release/hiredis.a
  CXX(target) Release/obj.target/hiredis/src/hiredis.o
make: g++: Command not found
make: *** [Release/obj.target/hiredis/src/hiredis.o] Error 127
make: Leaving directory `/home/andy/dev/nodebb/node_modules/reds/node_modules/redis/node_modules/hiredis/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:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.13.0-33-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/andy/dev/nodebb/node_modules/reds/node_modules/redis/node_modules/hiredis
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 

这与我的节点版本有关吗?

1 个答案:

答案 0 :(得分:0)

你的节点/ npm似乎很好, 它与使用npm-gyp。

为nodejs构建一些本机代码的依赖关系有关

@stropitek是正确的,因为你没有安装gcc(其中g ++是其中的一部分)所以它是破碎的

如果你正在运行Ubuntu,这应该可行......

sudo apt-get update sudo apt-get install build-essential

这将更新你的资源并安装构建工具,这应该让node-gyp感到高兴,你将能够npm install愉快地开始!