尝试安装pm2时出错

时间:2014-11-19 13:19:50

标签: node.js macos

我正在尝试在我的MAC OS版本10.8.5上安装pm2。但是当我安装它的时候。

我在我的MAC上安装了XCODE 5.1.1。但即使这样做我得到了gyp ERR! stack错误:找不到:make“。不是GNU make附带的XCODE并且应该理想地工作。

尝试安装时请参阅下面的整个错误。

Rajeshs-MacBook-Pro:~ rajesh$ npm install pm2

> fsevents@0.3.1 install /Users/rajesh/node_modules/pm2/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
-

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.



gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E (/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (evalmachine.:93:15)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rajesh/node_modules/pm2/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.11.14
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm WARN optional dep failed, continuing fsevents@0.3.1
pm2@0.12.1 node_modules/pm2
├── ikt@0.0.0
├── json-stringify-safe@5.0.0
├── commander@2.4.0
├── eventemitter2@0.4.14
├── colors@0.6.2
├── cli-table@0.3.0
├── pidusage@0.1.0
├── cron@1.0.5
├── async@0.9.0
├── isbinaryfile@2.0.2
├── vizion@0.2.1
├── axm@0.2.24
├── shelljs@0.3.0
├── moment@2.8.4
├── debug@2.1.0 (ms@0.6.2)
├── pm2-deploy@0.1.2 (tv4@1.0.18)
├── nssocket@0.5.1 (lazy@1.0.11)
├── pm2-axon-rpc@0.3.6 (commander@1.0.5)
├── coffee-script@1.8.0 (mkdirp@0.3.5)
├── pm2-rpc-fallback@3.0.9 (axon@1.0.0, commander@1.0.5)
├── pm2-multimeter@0.1.2 (charm@0.1.2)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── punt@2.2.0 (amp-message@0.1.2)
├── pm2-axon@2.0.7 (amp-message@0.1.2, escape-regexp@0.0.1, configurable@0.0.1, amp@0.3.1, debug@2.0.0)
├── pm2-logs@0.1.1 (blessed@0.0.36, pm2-interface@1.1.0, chalk@0.4.0)
└── chokidar@0.10.9 (async-each@0.1.6, readdirp@1.1.0)

3 个答案:

答案 0 :(得分:3)

您似乎需要首先打开Xcode并接受用户协议。

其次,当您打开xcode时,您必须确保还安装命令行工具:转到Preferences - > Downloads然后安装Command Line Tools

答案 1 :(得分:2)

正如@mscdex所述"同意Xcode / iOS许可证需要管理员权限,请通过sudo以root身份重新运行。"意味着尝试打开XCode并接受用户协议。我在更新bower依赖项时遇到了类似的问题。我接受了新协议,然后就解决了。

答案 2 :(得分:0)

package.json

"optionalDependencies": {
  "fsevents": "*"
}

然后做

npm i -f pm2

不再有错误;您可以使用npm list

进行验证