我无法通过NPM向Cordova项目添加平台

时间:2014-09-20 12:17:26

标签: android eclipse node.js cordova

我最近开始使用PhoneGap开发,我想查看NPM提供的自动安装。到目前为止,我一直在Eclipse中手动安装插件到我的PhoneGap项目。因此,我决定尝试自动化过程,因为手动安装在您知道的地方是如此痛苦。

我有什么:

  • 的NodeJS
  • ANT(WinANT)
  • JDK
  • 当然还有Android SDK

我遇到了一些错误,但在我按照此链接时,我几乎能够解决这些错误:http://codingsquare.blogspot.in/2013/08/creating-cordova-3-android-project.html

直到我达到这个命令'cordova -d platform add android'。我得到的错误是:

C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.
js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin\lib\check_
reqs.js:87:29
    at _rejected (C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin
\node_modules\q\q.js:808:24)
    at C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin\node_modul
es\q\q.js:834:30
    at Promise.when (C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\
bin\node_modules\q\q.js:1079:31)
    at Promise.promise.promiseDispatch (C:\Users\PSP\.cordova\lib\and
roid\cordova\3.5.1\bin\node_modules\q\q.js:752:41)
    at C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin\node_modul
es\q\q.js:574:44
    at flush (C:\Users\PSP\.cordova\lib\android\cordova\3.5.1\bin\nod
e_modules\q\q.js:108:17)
    at process._tickCallback (node.js:419:13)
Command finished with error code 8: cmd /s /c ""C:\Users\PSP\.cordova
\lib\android\cordova\3.5.1\bin\create.bat" --cli "D:\CaptainBlack\Android SDK\NP
M\pgapp\platforms\android" io.cordova.hellocordova HelloCordova"
Error: cmd: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\PSP\AppData\Roaming\npm\node_m
odules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

请帮帮我!

0 个答案:

没有答案