0
  1. Installed node.js
  2. Installed phonegap: npm install -g phonegap
  3. Created the example app: phonegap create hello com.example.hello HelloWorld
  4. Used the run command to test in Android: phonegap run android

What happened next is it didn't detect the Android SDK, so it asked me for build.phonegap.com account. I went ahead and created an account and entered user/pw and like magic, it created the app in the cloud. I pointed my qr code scanner to the screen and it installed on my Android phone. Cool, but...

I wanted to develop locally using the Android emulator. So I followed the instructions (http://docs.phonegap.com/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide) to install Android SDK, change PATH variables, etc.

When I went back to command line and cd to my phonegap root folder, suddenly "'phonegap' is not recognized as an internal or external command...'. I tried to reinstall phonegap with npm and it looks like it installs just fine again, but even when restarting cmd.exe, phonegap commands do not work.

Any ideas? Changing environment variables shouldn't affect phonegap already installed, right? The only other thing I can think is I had to install Ant and made an ANT_HOME system variable..

Apologies for the noob question. I'm sure I'm just messed up something simple here..

4

2 回答 2

0

最好使用Msysgit重新安装并提供正确的路径。在我的情况下,env变量路径如下,

C:\Program Files\nodejs\;           ->NodeJS path
F:\windows_adt\sdk\platform-tools;  ->SDK Platform Tools
F:\windows_adt\sdk\tools;           ->SDK Tools
C:\msysgit\bin;                     ->Bin Folder
C:\msysgit\git;                     ->git
C:\msysgit\libexec\git-core;        ->git-core, if you want. 

要减少进一步的错误,请使用推荐的 msysgit shell。

于 2013-11-21T04:00:56.313 回答
0

想通了。当我尝试为 android sdk 和 Ant 手动附加其他环境变量时,我不小心删除了 node.js 的环境变量。由于 phonegap 是作为节点包安装的,因此无法识别。

于 2013-09-05T22:01:35.593 回答