我收到一条错误消息:
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 shell,因为它可以进入我的 wamp/www 文件
最佳答案
您需要将安装 git 的目录添加到您的 PATH 环境变量中。
- 右键单击
计算机
。 - 点击高级系统设置
- 点击高级菜单中的环境变量
- 在系统变量下,滚动到
PATH
- 添加
;"C:\path\to\git\bin";"C:\path\to\git\cmd"
在命令提示符下测试 git 命令,看看它是否有效。 Git 通常位于 Program Files
或 Program Files(x86)
中。
关于php - 错误 : git was not found - installing laravel with composer windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20169348/