安装PhoneGap获取"找不到错误:git"

ric*_*b01 4 git node.js cordova

使用node.js安装PhoneGap时,出现上述错误.我以Admin身份运行Node.js命令提示符.以下是日志中的完整错误列表:

370 error not found: git
371 error Failed using git.
371 error This is most likely not a problem with npm itself.
371 error Please check if you have git installed and in your PATH.
372 error System Windows_NT 6.2.9200
373 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
374 error cwd C:\Windows\System32
375 error node -v v0.10.28
376 error npm -v 1.4.9
377 error code ENOGIT
378 verbose exit [ 1, true ]
Run Code Online (Sandbox Code Playgroud)

我已将我的git.exe路径添加到nodevars.bat文件中,当我在node.js cmd屏幕中输入'git'时,我得到了useage响应(证明git在路径中).

这是一台全新的机器,所以我可能会忽略一些东西,但我无法弄清楚是什么.

编辑:更多信息 - 我正在使用Windows 8.1,我正在使用"Node.js命令提示符"(窗口上的标题).我按照这里的说明操作:http://phonegap.com/install/

当我在提示符下键入git时,我得到:
C:\ Windows\System32> git usage:git [--version] [ - help] [-c name = value] [--exec-path [=]] [ - -html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [ - no-replace-objects] [--bare] [ - git-dir =] [ - work-tree =] [--namespace =] []

ric*_*b01 10

重新启动并尝试其他事情后,似乎npm脚本的某些部分没有找到git.我打开Git Shell并从那里运行命令.它安装.


小智 5

我有同样的问题,但我安装了以前的版本,它正在工作.试试这个:npm install -g phonegap@3.4