node.js - 为什么在安装 npm now 包时出现此错误?

标签 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

我收到上述错误;我该如何修复它?

最佳答案

您需要在系统上安装构建工具。根据目录路径,我可以假设您使用的是 Linux。例如,在 ubuntu 上,您可以像这样安装构建工具:sudo apt-get install -y build-essential,否则查看 this README查看需要安装哪些工具。

关于node.js - 为什么在安装 npm now 包时出现此错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21602986/

相关文章:

node.js - 找不到模块 'mongodb-client-encryption'

node.js - 创建一个接受参数的 expressjs 中间件

node.js - 使用 Npm start 启动项目期间出现项目错误,使用 create-react-app 创建的项目

javascript - materialize-css 未捕获类型错误 : Vel is not a function

node.js - 使用 pbkdf2 crypto 哈希密码无法正常工作

javascript - 使用 Socket.io 无需重新加载即可刷新页面上的数据

javascript - Node Socket.io 对象问题

node.js - 为什么socket.io不加入给定的房间?

python - 无法对项目进行 "npm install"

node.js - 等待 node.js 直到 Logstash 准备好使用容器