尝试安装nodejs pm2模块时出错

时间:2014-04-17 01:57:52

标签: node.js npm pm2

我尝试安装pm2模块,但我遇到了这个错误。操作系统是Ubuntu 14.04 Beta2。 Node.js版本是0.10.25,npm - 1.4.7。 我做错了什么?

halkar@halkar-nb-ubuntu:~/source$ sudo npm install pm2 -g
.......
npm http 304 https://registry.npmjs.org/fsevents
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/recursive-readdir
npm http 304 https://registry.npmjs.org/configurable
npm WARN optional dep failed, continuing fsevents@0.2.0

> usage@0.3.9 install /usr/lib/node_modules/pm2/node_modules/usage
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
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.13.0-19-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm http 304 https://registry.npmjs.org/escape-regexp
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/mkdirp
npm ERR! usage@0.3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1

1 个答案:

答案 0 :(得分:5)

作为一种解决方法,删除gyp为我解决了这个问题:

sudo apt-get remove gyp

以下是pm2存储库中列出的问题: https://github.com/Unitech/pm2/issues/434