尝试安装 pm2 时出错



我正在尝试在我的MAC OS版本10.8.5上安装pm2。但是当我陷入困境时。

我已经在我的MAC上安装了XCODE 5.1.1。 但即使在这样做之后,我也得到了gyp ERR! 堆栈错误:未找到:make".GNU make 不是随 XCODE 一起提供的,并且应该理想地工作。

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

Rajeshs-MacBook-Pro:~ rajesh$ npm install pm2> fsevents@0.3.1 安装/Users/rajesh/node_modules/pm2/node_modules/chokidar/node_modules/fsevents>节点重建child_process:不推荐使用自定义 Fds 选项,请改用 stdio。-同意 Xcode/iOS 许可证需要管理员权限,请通过 sudo 以 root 身份重新运行。嘎!构建错误嘎!堆栈错误:未找到:使嘎!stack at F (/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:43:28)嘎!stack at E (/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:46:29)嘎!stack at/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/which/which.js:57:16嘎!堆栈在 Object.oncomplete (evalmachine.:93:15)嘎!系统达尔文 12.5.0嘎!命令 "node" "/Users/rajesh/.nvm/v0.11.14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"嘎!cwd/Users/rajesh/node_modules/pm2/node_modules/chokidar/node_modules/fsevents嘎!节点 -v v0.11.14嘎!节点-gyp -v v1.0.2嘎!不行npm 警告可选 dep 失败,继续fsevents@0.3.1pm2@0.12.1 node_modules/下午2├── 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-轴突-rpc@0.3.6 (commander@1.0.5)├── 咖啡-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 (转义字符串-regexp@1.0.2, ANSI-styles@1.1.0, 支持-color@0.2.0, has-ansi@0.1.0, 条带-ansi@0.3.0)├── punt@2.2.0 (安培-message@0.1.2)├── PM2-axon@2.0.7 (安培-message@0.1.2, 逃逸-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 (异步-each@0.1.6, readdirp@1.1.0)

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

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

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

在你的package.json

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

然后做

npm i -f pm2

没有更多的错误;您可以使用npm list

最新更新