在Yosemite上安装Yeoman时出错

时间:2015-06-29 17:02:02

标签: javascript node.js npm yeoman

我尝试了几天在我的操作系统X中安装Yeoman但是我可以&t = /

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

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日志,请点击以下链接:http://pastebin.com/Arb6i58q

我非常感谢任何帮助

提前致谢。

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:0)

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

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

安装后:

npm install -g yo bower grunt-cli gulp