-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed as not planned
Closed as not planned
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
On Windows 10 with git previously installed :
- Download flutter and unzip it where you want (in my case C:\flutter)
- Add multiple environment variables (git, powershell, system32, flutter path, in my case C:\flutter) following cmd crash when using any flutter command #68820
- Open a new command prompt (cmd.exe) and try any flutter command. The command prompt will crash.
Actual results
The command prompt crashed instantly
Logs
Logs
I ran flutter in powershell and it gave me the following output :
PS C:\flutter> flutter
Error: Unable to find git in your PATH.
But then I checked that my git version :
PS C:\flutter> git --version
git version 2.40.0.windows.1
git and flutter are both in the path environment variable :
PS C:\flutter> where.exe flutter dart
C:\flutter\bin\flutter
C:\flutter\bin\flutter.bat
C:\flutter\bin\dart
C:\flutter\bin\dart.bat
PS C:\flutter> where.exe git
C:\Program Files\Git\cmd\git.exe
C:\Program Files\Git\bin\git.exe
I found a solution for that. You have to add the flutter base dir to the safe directory global config in git. (thanks to stackoverflow)
C:\flutter>git config --global --add safe.directory C:/flutter
The flutter command worked after that
PS C:\flutter> flutter
Manage your Flutter app development.
Common commands:
...
It would be great to add this directly to the installation documentation.
Flutter Doctor output
Not applicable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team