當使用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 –