Cordova平台添加ios-错误命令失败,退出代码2 [英] Cordova platform add ios - Error Command failed with exit code 2

查看:240
本文介绍了Cordova平台添加ios-错误命令失败,退出代码2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将iOS平台添加到我的cordova项目中,但是我仍然遇到相同的错误.我已按照此处的说明进行操作.

I am trying to add the iOS platform to my cordova project but I keep coming across the same error. I have followed the instructions here.

当我使用cordova platform add ios时,出现以下错误

When I use cordova platform add ios it gives me the following error

Shauns-MacBook-Pro:hello shaunbrown$ cordova platform add ios
Creating ios project...
Unknown option: n
Usage: head [-options] <url>...
Cordova can only run in Xcode version 4.6 or greater.
Error: /Users/shaunbrown/.cordova/lib/ios/cordova/3.5.0/bin/create: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)

我尝试查找该错误,但找不到任何内容.

I have tried looking around for the error but I can't find anything.

我正在运行xCode 5.1.1,所以我知道它与此无关.是否还有其他人遇到此问题,或者对此有解决方法?我正在拔头发试图修复它,到目前为止我什么都没有.

I am running xCode 5.1.1 so I know it doesn't have anything to do with that. Has anyone else came across this issue, or has a fix for this? I am pulling my hair out trying to fix it and so far I havent got anywhere.

如果需要,我可以提供更多信息.

I can provide more information if needed.

推荐答案

我设法解决了这个问题.我打开了.bash_profile文件,并注释了有关XAMPP安装的行.

I managed to solve this. I opened my .bash_profile file and commented out the line that referred to my XAMPP installation.

然后我重新启动终端,它运行正常.

I then restarted terminal and it worked perfectly.

这篇关于Cordova平台添加ios-错误命令失败,退出代码2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆