[英]error: git was not found - installing laravel with composer windows
我收到一個錯誤說:
failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env.
'git' is not recognized as and internal or external command, operable program or batch file
當我嘗試運行composer create-project laravel/laravel learning-laravel
。
我安裝了git GUI,它還帶有命令行shell,但我不知道為什么它不能識別命令(我在正常的Windows命令行提示符下發出了create-project命令)。
我也嘗試從git shell運行命令,但是當我嘗試php artisan serve
它給了我一個錯誤,說CLI已停止工作。
有誰知道如何修復git錯誤? 我寧願使用windows命令shell而不是git one,因為它可以進入我的wamp / www文件
您需要將安裝git的目錄添加到PATH環境變量中。
Computer
。 PATH
;"C:\\path\\to\\git\\bin";"C:\\path\\to\\git\\cmd"
在命令提示符下測試git命令以查看它是否有效。 Git通常位於Program Files
或Program Files(x86)
。
在Windows中添加路徑變量有一種更簡單(但是時間)的方法。
將其粘貼到命令提示符中:
SET PATH=%PATH%;C:\Program Files\Git\bin
這將適用於命令提示會話的其余部分。 不要忘記在此之前安裝Git。
如果要在常規命令提示符中使用git,則需要將git添加到系統PATH中。
以下是在Windows中修改系統路徑的指南:
你需要卸載git並重新安裝(或更新)你需要從git bash更改的選項,只允許將git添加到命令行,因為它然后將它添加到你可能需要或可能不需要的路徑重啟你的電腦
我在Windows上使用git時遇到了一些問題。 我只找到了這些信息,它對我有用。
http://ccn.ucla.edu/wiki/index.php/Setting_Up_and_Using_Git#Windows
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.