安装PhoneGap

菲利普·森

这是我第二天尝试安装PhoneGap,所以请放轻松这是我今天早上开始做的:

C:\Users\Phillip> npm install -g phonegap
C:\Users\Phillip> phonegap create my-app
C:\Users\Phillip> cd my-app
C:\Users\Phillip\my-app>phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
   [error] An error occured during creation of android sub-project.

C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\lib\check_reqs.js
:87:29
    at _rejected (C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_m
odules\q\q.js:808:24)
    at C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.
js:834:30
    at Promise.when (C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\nod
e_modules\q\q.js:1079:31)
    at Promise.promise.promiseDispatch (C:\Users\Phillip\.cordova\lib\android\co
rdova\3.3.0\bin\node_modules\q\q.js:752:41)
    at C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.
js:574:44
    at flush (C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_modul
es\q\q.js:108:17)
    at process._tickCallback (node.js:415:13)

编辑1:

C:\Users\Phillip\my-app>phonegap platform add android
   [error] 'platform add android' is not a node C:\Users\Phillip\AppData\Roaming
\npm\node_modules\phonegap\bin\phonegap.js command. See 'node C:\Users\Phillip\A
ppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js help'

编辑2:

C:\Users\Phillip\my-app>%userprofile%\.cordova\lib\android\cordova\3.3.0\bin\che
ck_reqs.bat
[Error: An error occurred while listing Android targets]

编辑3:

C:\Users\Phillip\my-app>npm install -g cordova 

编辑4:

C:\Users\Phillip>cordova create hello com.example.hello HelloWorld
Creating a new cordova project with name "HelloWorld" and id "com.example.hello"
 at location "C:\Users\Phillip\hello"
Downloading cordova library for www...
Download complete
C:\Users\Phillip>cd hello
C:\Users\Phillip\hello>cordova platform add ios
Downloading cordova library for ios...
Download complete
Creating ios project...
'C:\Users\Phillip\.cordova\lib\ios\cordova\3.4.0\bin\create' is not recognized a
s an internal or external command,
operable program or batch file.
Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (C:\Users\Phillip\AppData\Roaming\npm\node_modules\
cordova\src\superspawn.js:112: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)
克莱门特·邓格勒(Clement Dungler)

添加您的平台并首先构建它

npm install -g phonegap
phonegap create my-app
cd my-app
phonegap platform add android
phonegap platform build android
phonegap run android

也许可以在管理员模式下使用cmd.exe。因此,我浪费了很多时间。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章