尝试安装phonegap时出现许多错误和警告

时间:2015-06-24 22:53:51

标签: android cordova

我有一个使用phonegap编写的移动应用程序的源代码,我想将它构建到Android(APK)和IOS版本,源代码比使用手机间隙在线构建服务或XDK在线构建服务更大我试图安装phonegap并使用eclipse for android和xcode for ios构建我的应用程序。

我已经拥有JDK,Android工作室,我还在系统变量路径密钥中配置了JAVA,Android,Git所需的所有配置。

当我使用命令行安装这样的手机间隙" npm install -g phonegap"我有很多警告和错误:

C:\Users\ahmed.marzouk>npm install -g phonegap
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit     at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit     at Socket.<anonymous> (child_process.js:1183:11)
npm WARN addRemoteGit     at Socket.emit (events.js:107:17)
npm WARN addRemoteGit     at Pipe.close (net.js:485:12)
npm WARN addRemoteGit  git+https://github.com/filmaj/node-plist.git resetting re
mote C:\Users\ahmed.marzouk\AppData\Roaming\npm-cache\_git-remotes\https-github-
com-filmaj-node-plist-git-653fe22e because of error: { [Error: Command failed: g
it -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit     at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit     at Socket.<anonymous> (child_process.js:1183:11)
npm WARN addRemoteGit     at Socket.emit (events.js:107:17)
npm WARN addRemoteGit     at Pipe.close (net.js:485:12)
npm WARN addRemoteGit  git+https://github.com/imhotep/plugman.git#0.5.7 resettin
g remote C:\Users\ahmed.marzouk\AppData\Roaming\npm-cache\_git-remotes\https-git
hub-com-imhotep-plugman-git-20c32d58 because of error: { [Error: Command failed:
 git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm WARN engine ncallbacks@1.0.0: wanted: {"node":"~0.6.7"} (current: {"node":"0
.12.5","npm":"2.11.2"})
-
> cordova@2.7.4 install C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\
phonegap\node_modules\cordova
> node bootstrap.js

SUCCESS: Minimum requirements for blackberry met.
BOOTSTRAPPING blackberry...
WARNING: Your system does not meet requirements to create wp7 projects. See erro
r output below.
'C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap\node_modules\c
ordova\lib\cordova-wp7\bin\check_reqs' is not recognized as an internal or exter
nal command,
operable program or batch file.

SKIPPING wp7 bootstrap.
WARNING: Your system does not meet requirements to create ios projects. See erro
r output below.
Xcode is (probably) not installed, specifically the command `xcodebuild` is unav
ailable or erroring out. Output of `xcodebuild -version` is: 'xcodebuild' is not
 recognized as an internal or external command,
operable program or batch file.

SKIPPING ios bootstrap.
WARNING: Your system does not meet requirements to create wp8 projects. See erro
r output below.
'C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap\node_modules\c
ordova\lib\cordova-wp7\bin\check_reqs' is not recognized as an internal or exter
nal command,
operable program or batch file.

SKIPPING wp8 bootstrap.
ERROR! Could not create a native blackberry project test fixture. See below for
error output.
Missing one of the following:
JDK: http://java.oracle.com
Apache ant: http://ant.apache.org

WARNING: Your system does not meet requirements to create android projects. See
error output below.
Please install Android target 17 (the Android 4.2 SDK). Make sure you have the l
atest Android tools installed as well. Run `android` from your command-line to i
nstall/update any missing SDKs or tools.
SKIPPING android bootstrap.
C:\Users\ahmed.marzouk\AppData\Roaming\npm\phonegap -> C:\Users\ahmed.marzouk\Ap
pData\Roaming\npm\node_modules\phonegap\bin\phonegap.js
phonegap@0.9.4 C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap
├── colors@0.6.2
├── semver@1.1.0
├── qrcode-terminal@0.9.5
├── shelljs@0.0.9
├── optimist@0.3.7 (wordwrap@0.0.3)
├── node-static@0.6.9 (mime@1.3.4)
├── phonegap-build@0.8.0 (qrcode-terminal@0.8.0, phonegap-build-api@0.3.3)
├── prompt@0.2.14 (pkginfo@0.3.0, revalidator@0.1.8, read@1.0.6, winston@0.8.3,
utile@0.2.1)
└── cordova@2.7.4 (ncallbacks@1.0.0, open@0.0.3, shelljs@0.1.2, elementtree@0.1.
3, request@2.11.4, xcode@0.5.1, prompt@0.2.7, plist@0.4.0, express@3.0.6, ripple
-emulator@0.9.29, plugman@0.5.6)

我需要知道,是否正确安装了phonegap?如果没有,我该如何解决这个问题呢?

由于

1 个答案:

答案 0 :(得分:1)

我找到了解决方案。 首先,如果您在git中遇到任何问题,例如找不到&#39; git path&#39;你应该按照这里的说明进行操作:installing-git-in-path。  要解决上述问题,你应该:

  1. 首先以管理员身份运行您的cmd,它将解决问题的一半。
  2. 如果有任何与Android SDK相关的问题,如

    警告:您的系统不符合创建Android项目的要求。看到 错误输出如下。 请安装Android目标17(Android 4.2 SDK)。

  3. in cmd&gt;

    android
    

    然后检查Android 4.2 SDK并安装它。

    由于