我已经通过 NodeJS CLI 在 Ubuntu 13.10 上安装了 PhoneGap 并开始了本机构建过程。然而,在初始化期间,这是执行的命令和相应的输出。
$ sencha phonegap init com.foo.barapp BarApp
Sencha Cmd v4.0.2.67
[INF]
[INF] sencha-phonegap-init:
[INF]
[INF] init-phonegap:
[INF] [echo] Adding PhoneGap to Application
[INF] [echo] Adding PhoneGap template files
[INF] [echo] Adding Native properties
[INF] [x-property-file] Updating property file: /tmp/BarApp/.sencha/app/native.properties
[INF] [x-property-file] Updating property file: /tmp/BarApp/.sencha/app/build.properties
[INF] [echo] Patching build.xml for PhoneGap Support
[INF] [echo] Building PhoneGap App
[ERR] The following error occurred while executing this line:
/opt/sencha/cmd/4.0.2.67/extensions/cmd-phonegap-packager/cmd-phonegap-packager.plugin.xml:131: The following error occurred while executing this line:
jar:file:/opt/sencha/cmd/4.0.2.67/sencha.jar!/com/sencha/ant/antlib.xml:608: shellscript returned: 1
同样的问题也发生在科尔多瓦身上。
我找到的解决方案是重新定义在phonegap.js中设置的env值:
$ git diff phonegap.js
$ diff --git a/lib/node_modules/phonegap/bin/phonegap.js b/lib/node_modules/phonegap/bin/phonegap.js
index b6e469b..e1eb83f 100755
--- a/lib/node_modules/phonegap/bin/phonegap.js
+++ b/lib/node_modules/phonegap/bin/phonegap.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env node
+#!/usr/bin/env nodejs
/*!
* Module dependencies.eplace the interpreted value set at phonegap.js file.
Cordova 脚本也可以这样做。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)