如何解决 Flutter 上的“无法在您的 PATH 中找到 git”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51263438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve "Unable to find git in your PATH" on Flutter?
提问by Nikolay Shindarov
I've just tried to install Flutter on Linux and when I try to run a flutter command (flutter doctor), I'm getting
我刚刚尝试在 Linux 上安装 Flutter,当我尝试运行 flutter 命令(flutter doctor)时,我得到了
Error: Unable to find git in your PATH.
Anyone who knows how to solve this?
有谁知道如何解决这个问题?
回答by Marlon Abeykoon
Install it using following command.
使用以下命令安装它。
sudo apt-get install git
sudo apt-get install git
回答by Marwa Eltayeb
Add
添加
C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32
to your PATH variable
到您的 PATH 变量
Do not create new variable for git but add them as I did one after another separating them by ;
不要为 git 创建新变量,而是像我一样将它们一个接一个地添加,用 ;
回答by Dennis Bareis
[ASSUMING GIT IS INSTALLED CORRECTLY] I have documented the bug at "https://github.com/flutter/flutter/issues/39785", it's a simple change to the batch file.
[假设 GIT 安装正确] 我已经在“ https://github.com/flutter/flutter/issues/39785”记录了该错误,这是对批处理文件的简单更改。
回答by Furkan ?ztürk
I had the same problem on Windows 10. I've tried evertyhing but running cmd as Administratorsolved my problem. This may be helpful for others.
我在 Windows 10 上遇到了同样的问题。我已经尝试过evertyhing,但是以管理员身份运行 cmd解决了我的问题。这可能对其他人有帮助。