PhoneGap“git”命令行工具未安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19256096/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PhoneGap "git" command line tool is not installed
提问by Augie Gardner
I'm using Phonegap 3.0 and the Command Line Interface as per the phonegap website install instructions. I have created an app just fine on iOS:
我正在按照 phonegap 网站安装说明使用 Phonegap 3.0 和命令行界面。我在 iOS 上创建了一个很好的应用程序:
npm install -g phonegap...
npm install -g phonegap...
phonegap create Test -n Test(creates an app named "Test" and located in "Test" folder)
phonegap create Test -n Test(创建一个名为“Test”并位于“Test”文件夹中的应用程序)
phonegap build iosthen...
phonegap build ios然后...
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.gitWhich responds with this error:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git响应此错误:
Error fetching plugin: Error: "git" command line tool is not installed: make sure it is accessible on your PATH.
Error fetching plugin: Error: "git" command line tool is not installed: make sure it is accessible on your PATH.
Now, I have tried installing the "git" command line tool, but I'm not exactly sure if I'm installing it right, or if I was even downloading the right thing, or how to align the PATH to be accessible.
现在,我已经尝试安装“git”命令行工具,但我不确定我是否安装正确,或者我是否下载了正确的东西,或者如何对齐 PATH 以使其可访问。
Any advice here? Has anyone dealt with or seen this? Thank you very much
这里有什么建议吗?有没有人处理或看到这个?非常感谢
回答by Nithyanandan Sathiyanathan
Hi "git" is also a node module. Simplest way want i found is.
嗨,“git”也是一个节点模块。我想要的最简单的方法是。
npm install -g git
This will install git in you node source location as a module.
这会将 git 作为模块安装在您的节点源位置。
Restart the machine.
重新启动机器。
Install phonegap plugin:
安装phonegap插件:
C:\Users\user1\yourprojectname>cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
You will get response as:
您将得到如下响应:
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-cam
era.git"...
Starting installation of "org.apache.cordova.camera" for android
Preparing android project org.apache.cordova.camera installed on android.
Hope this will be very helpful. If any issue reply.
希望这会很有帮助。如有问题回复。
回答by Sandip Kalola - SK
Download and install git from http://git-scm.com/downloads. Set path in System Environment variable pointing to the installation path, in my case C:\Program Files (x86)\Git\bin.
从http://git-scm.com/downloads下载并安装 git 。在指向安装路径的系统环境变量中设置路径,在我的例子中是 C:\Program Files (x86)\Git\bin。
So go to control panel-> system ->Advance System Settings -> Environment Variable -> System Variable
所以去控制面板->系统->高级系统设置->环境变量->系统变量
Select Path and Edit it. Append C:\Program Files (x86)\Git\bin to it.
选择路径并编辑它。将 C:\Program Files (x86)\Git\bin 附加到它。
It will work for sure.
它肯定会起作用。

