安装ios-sim 1.9.0时在rake build期间的预安装失败

我的ios-sim在安装系统更新后最近打破了,我试图重新安装它。 目前,它没有安装在我的目录中。 当运行sudo npm install -g ios-sim ,我收到这个错误。

 $ sudo npm install -g ios-sim npm http GET https://registry.npmjs.org/ios-sim npm http 304 https://registry.npmjs.org/ios-sim > ios-sim@1.9.0 preinstall /usr/local/lib/node_modules/ios-sim > rake build events.js:72 throw er; // Unhandled 'error' event ^ Error: Cannot find module './ios-sim' from '/usr/local/lib/node_modules/ios-sim' at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:36:25 at load (/usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:54:43) at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:60:22 at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:16:47 at Object.oncomplete (fs.js:107:15) npm ERR! ios-sim@1.9.0 preinstall: `rake build` npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the ios-sim@1.9.0 preinstall script. npm ERR! This is most likely a problem with the ios-sim package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! rake build npm ERR! You can get their info via: npm ERR! npm owner ls ios-sim npm ERR! There is likely additional logging output above. 

我已经更新Node.JS到1.4.3。

有谁知道为什么会发生这种情况,我该如何解决?

在我的系统上使用node.js(v0.10.8)

 $ sudo npm install -g ios-sim 

也失败了..

然而

 $ git clone git://github.com/phonegap/ios-sim.git $ cd ios-sim $ sudo rake install prefix=/usr/local 

工作很好..

你只需要设置你的开发人员活动目录:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

然后,您可以npm install ios-sim -gnpm install ios-sim -g

检查你的Xcode版本,报告。 你是否也安装了Xcode命令行工具? 如果你在小牛队:

 $ xcode-select --install