Cordova 3.0 Plugin 安装 及"git" command line tool is not installed

时间:2021-07-28 07:55:33

根据http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface

Windows命令行进入项目目录后,安装Plugin使用命令:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
不过对于Corova,应该是:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

但是提示错误:

[Error: Error fetching plugin: Error: "git" command line tool is not installed:
make sure it is accessible on your PATH.]

需要安装Git,参考:
https://help.github.com/articles/set-up-git

但是下载时http://git-scm.com/downloads有墙,搜到:http://www.noanylove.com/2011/11/to-use-the-git-in-the-windows/

下载地址是:https://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git

安装Git时,我选了“Run Git from the Windows Command Prompt”,直接把Git路径设置好。

重新打开命令行窗口再试cordova plugin add就可以了。