简体   繁体   English

由于ant错误,Phonegap- platform add命令未执行

[英]Phonegap- platform add command not executed due to ant error

when i try to add platform by this command cordova platform add android i got the below error 当我尝试通过此命令添加平台cordova platform add android时 ,出现以下错误

i search a lot and try every possible solution but could not fix this ANT error 我进行了很多搜索并尝试所有可能的解决方案,但无法修复此ANT错误

please provide me some suggestion how do i fix it. 请给我一些建议,我该如何解决。

C:\Users\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 126
                    throw e;
                          ^ Error: ERROR : executing command 'ant', make sure you have ant installed and add ed to your path.
    at C:\Users\.cordova\lib\android\cordova\3.4.0\bin\lib\check_req s.js:47:27
    at exithandler (child_process.js:633:7)
    at ChildProcess.errorhandler (child_process.js:649:5)
    at ChildProcess.EventEmitter.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:795:12) Error: C:\Users\.cordova\lib\android\cordova\3.4.0\bin\create.bat: C ommand failed with exit code 8
    at ChildProcess.whenDone (C:\Users\AppData\Roaming\npm\node_modu les\cordova\src\superspawn.js:126:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)

You need to install Apache ANT on your system and set the ant path in your system environment variables. 您需要在系统上安装Apache ANT并在系统环境变量中设置ant路径。 Set the below options in the user variables. 在用户变量中设置以下选项。

ANT_HOME  C:\apache-ant-1.8.2

Path ;C:\apache-ant-1.8.2\bin

Replace C:\\apache-ant-1.8.2 with the ant installation path on your system. 将C:\\ apache-ant-1.8.2替换为系统上的ant安装路径。 And you need add ;C:\\apache-ant-1.8.2\\bin to your path. 并且您需要在路径中添加; C:\\ apache-ant-1.8.2 \\ bin。 Don't replace it. 不要更换它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM