在 Yosemite 上安装 Yeoman 时出错

Error installing Yeoman on Yosemite

几天前我正在尝试在我的 OS X 中安装 Yeoman,但我不能 =/

当我尝试安装时出现此错误:

Mac-Pro:~ pauloricardo$ sudo npm i -g yo
Password:

> spawn-sync@1.0.11 postinstall /usr/local/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

sh: node: command not found
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "i" "-g" "yo"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! spawn-sync@1.0.11 postinstall: `node postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.11 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/pauloricardo/npm-debug.log

我已经尝试以 root 用户身份安装并清理 npm 缓存。但我也一样。

如果有人想看我的 npm 日志,这里是 link:http://pastebin.com/Arb6i58q

如有任何帮助,我将不胜感激

提前致谢。

您的机器上似乎没有安装节点。

https://nodejs.org/dist/v0.12.5/node-v0.12.5.pkg

安装后:

npm install -g yo bower grunt-cli gulp

试试 运行 sudo npm install -g --unsafe-perm yo。这是某种许可问题。看看这个 github 线程,他们还提供了一些其他解决方案 https://github.com/ForbesLindesay/spawn-sync/issues/11