当使用node.js安装PhoneGap时,出现上述错误。我以Admin身份运行Node.js命令提示符。下面是从错误日志的完整列表:安装PhoneGap得到“错误未找到:git”
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 ]
我已经加入我的路径git.exe到nodevars.bat文件,当我在Node.js的命令屏幕键入“混帐”,我得到用户响应(证明git在路径中)。
这是一个全新的机器,所以我可能忽略了一些东西,但我无法弄清楚什么。
编辑:更多信息 - 我正在使用Windows 8.1,并使用“Node.js命令提示符”(窗口上的标题)。我是从这里的操作说明:http://phonegap.com/install/
当我在提示符处键入我得到的git:
C:\ Windows \ System32下> git的 用法:混帐[--version] [--help] [ - c-name-value] [--exec-path [=]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no- [--git-dir =] [--work-tree =] [--namespace =] []
为什么在“node.js cmd screen”(你指的是节点REPL?)中使用Git?打开命令行(不是node.js之一)并在那里输入git,向我们显示结果。 –
不,我一定使用node.js命令屏幕。 (请参阅编辑)。 git命令由npm调用,我想。我很确定npm试图使用git下载文件,并且出于某种原因,它在脚本内部失败。 – richb01
节点命令屏幕不会安装任何东西,它只是演示代码。你必须从命令行安装它,即cmd.exe –