在Yosemite上安装Yeoman时出错
我试了几天来安装Yeoman在我的OS X,但我不能= /
当我尝试安装时,我得到这个错误:
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用户身份安装并清理npmcaching。 但是我也一样。
如果有人想看我的npm日志,请点击链接: http : //pastebin.com/Arb6i58q
我会很感激任何帮助
提前致谢。
尝试运行sudo npm install -g --unsafe-perm yo
。 这是某种权限问题。 看看这个github线程,他们还提供了一些其他的解决scheme以及https://github.com/ForbesLindesay/spawn-sync/issues/11 。
看起来你没有在你的机器上安装节点。
https://nodejs.org/dist/v0.12.5/node-v0.12.5.pkg
安装之后:
npm install -g yo bower grunt-cli gulp