安装的PhoneGap科尔多瓦3.0 [英] Installing PhoneGap Cordova 3.0

查看:128
本文介绍了安装的PhoneGap科尔多瓦3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的的PhoneGap 2.9 的发展,这是pretty容易安装的,但的PhoneGap 3.0 使用了一些和的NodeJS命令行进行安装。我发现这个教程,但我停留在一步。直到这条线,

I was using phonegap 2.9 for development, it was pretty easy installing that but, phonegap 3.0 uses some nodejs and command line for installation. I found this tutorial but I am stuck at one step. untill this line,

   npm install -g plugman.

它是工作的,但此步骤之后是有线,

it is working, but after this step there is a line,

然后切换到工作目录到项目目录。

Then change to the working directory to the project directory.

我不明白这一点,并得到一个错误,当我运行

I can't figure this out and getting an error when i run

cordova -d platform add android

这是我面对错误,

C:\Users\Comp\AppData\Roaming\npm\node_modules\cordova\src\util.js:57
        throw new Error('Current working directory is not a Cordova-based
              ^
Error: Current working directory is not a Cordova-based project.
at Object.module.exports.cdProjectRoot (C:\Users\Comp\AppData\Roaming\npm\no
de_modules\cordova\src\util.js:57:19)
at CLI.platform (C:\Users\Comp\AppData\Roaming\npm\node_modules\cordova\src\
platform.js:35:36)
at new CLI (C:\Users\Comp\AppData\Roaming\npm\node_modules\cordova\src\cli.j
s:109:30)
at Object.<anonymous> (C:\Users\Comp\AppData\Roaming\npm\node_modules\cordov
a\bin\cordova:41:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

我想你还没有创建一个新项目:
科尔多瓦创建[路径] [ID] [NAME]

I think you haven't created a new project with: cordova create [PATH] [ID] [NAME]

这将创建一个
.cordova,平台和www文件夹。
当您使用3.3事情有点不同,你不会有在这种情况下一个文件夹.cordova但是这并不重要。

This will create a .cordova, platform and www folder. Things are a bit different when you use 3.3, you won't have a .cordova folder in that case but that doesn't really matter.

运行创建命令你应该添加Android平台(后CD-ING进入你的科尔多瓦创建命令进入路径),科尔多瓦平台添加机器人后。
现在,你应该将2.9的应用www文件夹中的内容复制到科尔多瓦创建的www文件夹。

After running the create command you should add the android platform (after cd-ing into the path you entered with the cordova create command) with "cordova platform add android". Now you should copy the contents of your 2.9 app www folder to the www folder Cordova created.

运行科尔多瓦构建Android,你会发现,它复制www文件夹为平台/安卓/入资产价值/ WWW,你永远不应该因为运行科尔多瓦构建Android命令将覆盖它改变的东西在这里经过。

After running "cordova build android" you will notice that it copied the www folder to "platforms/android/assests/www", you should never change things here because running the cordova build android command will overwrite it.

更多信息:<一href=\"http://cordova.apache.org/docs/en/3.2.0/guide_platforms_android_upgrading.md.html#Upgrading%20Android\" rel=\"nofollow\">http://cordova.apache.org/docs/en/3.2.0/guide_platforms_android_upgrading.md.html#Upgrading%20Android

这篇关于安装的PhoneGap科尔多瓦3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆