错误:git未找到 - 安装laravel与作曲家窗口 [英] error: git was not found - installing laravel with composer windows

查看:2904
本文介绍了错误:git未找到 - 安装laravel与作曲家窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条错误消息:

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命令)。

I installed the git GUI which also comes with a command line shell, but I don't know why its not recognising the command (I'm issuing the create-project command in the normal windows command line prompt).

我也试过从git shell运行命令,但是当我尝试 php artisan serve 时,已停止工作。

I also tried running the command from the git shell, which worked, but when I tried php artisan serve it gave me an error saying CLI has stopped working.

有人知道如何修复git错误?我宁愿使用windows命令shell而不是git,它可以进入我的wamp / www文件。

Does anyone know how to fix the git error? I'd rather use the windows command shell instead of the git one as it can then go into my wamp/www file

推荐答案

您需要将您安装的git目录添加到您的PATH环境变量。

You need to add the directory you installed git to to your PATH environment variable.


  1. 右键点击电脑

  2. 点击高级系统设置

  3. 点击高级菜单中的环境变量

  4. 在系统变量下,滚动到 PATH

  5. 添加;C:\path\to\git\bin;C:\path\to\\ \\ git\cmd

  1. Right click on Computer.
  2. Click Advanced System Settings
  3. Click Environment Variables inside the Advanced Menu
  4. Under System Variables, scroll to PATH
  5. Add ;"C:\path\to\git\bin";"C:\path\to\git\cmd"

在命令提示符下测试git命令, Git通常位于程序文件程序文件(x86)中。

Test the git command in the command prompt to see if it worked. Git is usually located in Program Files or Program Files(x86).

这篇关于错误:git未找到 - 安装laravel与作曲家窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆