安装npm now包时为什么会出现此错误?

时间:2014-02-06 12:27:26

标签: node.js socket.io npm

当我尝试安装now包时,它会给我以下错误:

npm install now
    npm WARN package.json Paint_HTML5_multi@0.3.0 No repository field.
    npm WARN package.json Paint_HTML5_multi@0.3.0 No README data
    npm http GET https://registry.npmjs.org/now
    npm http 304 https://registry.npmjs.org/now
    npm http GET https://registry.npmjs.org/node-proxy
    npm http 304 https://registry.npmjs.org/node-proxy
    npm WARN engine node-proxy@0.8.0: wanted: {"node":">=0.11.x","npm":">= 1.1.17"} (current: {"node":"v0.10.25","npm":"1.3.24"})
    npm http GET https://registry.npmjs.org/bindings
    npm http GET https://registry.npmjs.org/nan
    npm http 304 https://registry.npmjs.org/nan
    npm http 304 https://registry.npmjs.org/bindings

    > node-proxy@0.8.0 install /home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7/node_modules/now/node_modules/node-proxy
    > node-gyp configure build

    make: Entering directory `/home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7/node_modules/now/node_modules/node-proxy/build'
      CXX(target) Release/obj.target/nodeproxy/src/node-proxy.o
    make: g++: Command not found
    make: *** [Release/obj.target/nodeproxy/src/node-proxy.o] Error 127
    make: Leaving directory `/home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7/node_modules/now/node_modules/node-proxy/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.EventEmitter.emit (events.js:98:17)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
    gyp ERR! System Linux 3.8.0-35-generic
    gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
    gyp ERR! cwd /home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7/node_modules/now/node_modules/node-proxy
    gyp ERR! node -v v0.10.25
    gyp ERR! node-gyp -v v0.12.2
    gyp ERR! not ok 
    npm ERR! node-proxy@0.8.0 install: `node-gyp configure build`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the node-proxy@0.8.0 install script.
    npm ERR! This is most likely a problem with the node-proxy package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-gyp configure build
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls node-proxy
    npm ERR! There is likely additional logging output above.

    npm ERR! System Linux 3.8.0-35-generic
    npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "now"
    npm ERR! cwd /home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7
    npm ERR! node -v v0.10.25
    npm ERR! npm -v 1.3.24
    npm ERR! code ELIFECYCLE
    npm ERR! 
    npm ERR! Additional logging details can be found in:
    npm ERR!     /home/ritzy1/Downloads/downloaded codes/drawing app/Paint_HTML5_Multi_Tutorial/Step7/npm-debug.log
    npm ERR! not ok code 0

我收到了上述错误;我该如何解决?

1 个答案:

答案 0 :(得分:0)

您需要在系统上安装构建工具。基于目录路径,我可以假设你正在使用linux。例如,在ubuntu上,您可以安装如下所示的构建工具:sudo apt-get install -y build-essential,否则请查看this README以查看需要安装的工具。