flutter doctor doesn't work on neither Command Prompt or PowerShell window?

flutter doctor doesn't work on either Command Prompt or PowerShell window? I have been trying to install flutter on windows. I have cloned the Flutter SDK as mentioned in the tutorial. I have added git and the flutter to my path. But still when I try to run the flutter doctor the command prompt reply with this:

'where' is not recognized as an internal or external command operable program or batch file.
Error: Unable to find git in your path

enter image description here

check the cmd image you will see exactly the problem


Solution 1:

to run flutter from the command prompt on your windows system it requires three things

  1. path to the bin folder of downloaded flutter sdk I have downloaded and saved the sdk in my documents so for me path will be

C:\Users\mahesh_2\Documents\flutter_windows_v0.11.9-beta\flutter\bin

  1. where.exe located at C:\Windows\System32

Note:you need to download git from here if you dont find path in step 3

  1. git-cmd.exe located in C:\Program Files\Git\git-cmd.exe

so to simply add these three paths to your environment variables go to system environment variables with variable name as Path

and value as

C:\Windows\System32;C:\Program Files\Git\git-cmd.exe;C:\Users\mahesh_2\Documents\flutter_windows_v0.11.9-beta\flutter\bin

enter image description here

restart the command prompt and try running flutter and Voila! you should get something like this

enter image description here

Solution 2:

1) Make sure that the environment variables are set correctly,

  • Go to “Control Panel > User Accounts > User Accounts > Change my environment variables”

  • Under “User variables” check if there is an entry called “Path”:

    • If the entry does exist, append the full path to flutter\bin using ; as a separator from existing values.

    • If the entry does not exist, create a new user variable named Path with the full path to flutter\bin as its value.

2) Reboot your computer

Once both above steps are done, run flutter doctor

Note: Run this command in either a Command Prompt or PowerShell window. Currently, Flutter does not support third-party shells like Git Bash. (Source: Flutter Documentation)

Solution 3:

I had the exact same issue, and by following the solution given here, I was able to resolve this.

The issue was C:\Windows\System32\ was missing from my PATH variable. So, to resolve it just follow the below steps:

  1. In Search, search for and then select: System (Control Panel)

  2. Click the Advanced system settings link.

  3. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit.

  4. In the Edit System Variable window, add C:\Windows\System32 separated by a ;. Click OK. Close all remaining windows by clicking OK.

  5. Restart your computer.

Now run flutter doctor

Solution 4:

Solving above issue

Set the three variable path

  • First Flutter path (Mainly in c drive)

    C:\src\flutter\bin

  • Second GIT Path

    C:\Program Files\Git\cmd

  • Third System32 path

    C:\Windows\System32

Use Window command Prompt if you working with Window , Restart the command prompt it will work properly.

Run Command

flutter upgrade