22

我刚刚尝试在 Linux 上安装 Flutter,当我尝试运行颤振命令(颤振医生)时,我得到了

Error: Unable to find git in your PATH.

我该如何解决这个问题?

4

13 回答 13

26

使用以下命令安装它。

sudo apt-get install git

于 2018-07-10T11:08:08.737 回答
24

添加

C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32 

到您的 PATH 变量

不要为 git 创建新变量,而是像我一样添加它们,用 ; 分隔它们。

于 2019-03-25T19:21:40.237 回答
6

只需添加C:\Windows\System32到您的系统变量PATH。有用

于 2020-07-24T07:35:10.207 回答
4

我也遇到了同样的问题,因为我的系统没有安装 git。所以我从https://git-scm.com/downloads下载了 git并安装了它,安装后它就可以工作了。

于 2020-12-14T20:49:45.037 回答
3

我在 Windows 10 上遇到了同样的问题。我已经尝试了所有方法,但以管理员身份运行 cmd解决了我的问题。

于 2020-05-17T11:48:50.440 回答
2

您可以下载 64 位 Git for Windows Setup https://git-scm.com/download/win

于 2020-12-14T03:52:50.733 回答
1

对于 WINDOWS:如果您在 git 安装期间选择了 Visual Studio 代码并且在 Windows 上有多个用户帐户,那么您需要做的就是卸载 git 并重新安装 git,选择 vim 作为默认编辑器而不是 Visual Studio 代码。在 git 安装期间选择 Visual Studio 代码时也会收到警告。注意这一点。对我来说,将 Visual Studio 代码设置为默认值并拥有多个用户帐户是问题所在。

于 2020-12-21T06:04:11.490 回答
1

卸载重新安装GIT 解决了我的问题。

于 2020-10-20T04:11:12.800 回答
0

添加路径后: C:\src\flutter\bin C:\Windows\System32 C:\Windows\System32\WindowsPowerShell\v1.0 C:\Program Files\Git\bin\git.exe C:\Program Files\Git \cmd 尝试使用 windows powershell (admin),它对我有用

于 2021-10-26T16:07:58.203 回答
0

在 Windows 10 C:\src\flutter\bin C:\Windows\System32 C:\Windows\System32\WindowsPowerShell\v1.0 C:\Program Files\Git\bin\git.exe C:\Program Files\Git\命令

于 2021-06-12T09:00:27.007 回答
0

尝试根据您的 linux 发行版 https://git-scm.com/download/linux从此处安装 git

于 2021-07-28T16:53:27.040 回答
-1

只要让你的路径像这样,它就可以了

C:\Windows\System32;C:\Users\HP\flutter\bin

于 2021-11-21T04:38:56.597 回答
-2
C:\src\flutter\bin;C:\Windows\System32

只需添加此路径

于 2020-10-13T07:50:10.497 回答