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

PowershellFlutterCommandFlutter Doctor

Powershell Problem Overview


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

Powershell Solutions


Solution 1 - Powershell

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 - Powershell

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 - Powershell

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 - Powershell

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

Solution 5 - Powershell

Had the same issue and solved it by making sure flutter PATH was added in the environment variables... within the system variables box when you "edit the system environment variables. Editing the upper-box called "user variables" did not solve the problem for me.

Solution 6 - Powershell

Simply check all the Environmental variables ... these are present in path Variable or not, in case of Flutter

C:\Windows\System32;
C:\Program Files\Git\cmd;
C:\Program Files\Java\jdk1.8.0_221\bin;
D:\flutter_windows_v1.7.8+hotfix.4-stable\flutter\bin\

System32 file is important for git. please check is it present or not.

Solution 7 - Powershell

There are two mistakes to be avoided:

  1. Add it to the System variables Path, not the user variables path

  2. In the Windows 10 Interface do not mistake the new variable for the solution to add your path to the Path-variable. In most cases there should alrady be a variable named Path (otherwise create one) which contains all paths and you have to append your path to flutter/bin to this Path-variable.

Solution 8 - Powershell

I have same issue. (I already add env variable n works fine last week) the problem is my antivirus delete flutter.bat in flutter\bin.

i fix this, after redownload flutter.bat or redownload whole flutter.

Solution 9 - Powershell

I just removed the existing path and added a new one to make it work.

  1. Delete existing Path

  2. Create a new user variable named Path with the full path to flutter\bin as its value

  3. Set the three variable path:

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

D:\flutter\flutter\bin should be replaced with the path to your drive (the placed where you extracted Flutter zip file

Close and reopen the console for these changes to take effect.

Solution 10 - Powershell

First of all where.exe command is located inside C:windows\System32, so go to

  1. Edit the System Environment Setting
  2. Click Environment and edit,
  3. Then inside 'Path' add C:windows\System32 separated by ;
  4. Finally add C:\Program Files\Git\git-cmd.exe click OK

Now restart your cmd again.

Solution 11 - Powershell

If your working in Android Studio, you will find it on the

Tools -> Flutter -> Flutter Doctor

Running flutter doctor on the cmd is not recognizable as internal or external command.

Flutter

But on Android Studio Terminal, it run just fine.

flutter doctor


P.S - If you use Android Studio as your IDE, don't forget to install the Flutter Plugin and Dart Plugin.

Solution 12 - Powershell

I was also stuck in the same problem where I was running flutter command on Window default command prompt. Although I have already added the C:\src\flutter\bin path in User Environment Variables. The solution that works for me is to add C:\Windows\System32\ into the Path variable in User Environment Variables. Once you have done this restart your system and run flutter command on default Command Prompt.

Hope this will help you out.

Solution 13 - Powershell

I also encountered that when I was installing flutter.

Add those to System variables (not user variables), besides flutter itself:

C:\Flutter\flutter_windows_2.2.1-stable\flutter\bin

make sure you have System32, Git and PowerShell

C:\Program Files\Git\cmd
C:\Program Files\Git\bin
C:\Windows\System32
C:\Windows\System32\WindowsPowerShell\v1.0

Flutter doctor will also complain about Java so make sure you install and add the java sdk to path as well:

C:\Program Files\Java\jdk-12.0.2\bin

The problem on my side was that PowerShell was missing from path.

Solution 14 - Powershell

Remove spaces before and after each path in your Environment Variables!

// incorrect value
C:\src\flutter\bin; C:\Program Files\Git\git-cmd.exe; C:\Windows\System32\

// correct value
C:\src\flutter\bin;C:\Program Files\Git\git-cmd.exe;C:\Windows\System32\

Solution 15 - Powershell

It didn't work for me either. But when I installed what is written here, I rebooted my computer and everything worked for me. enter image description here

Solution 16 - Powershell

If your like me and adding flutter to the user environment didnt work, you can actually run the command by replacing flutter with the path of your flutter.bat file like so : C:\fluttersdk\flutter\bin\flutter.bat doctor this works the same way if your running flutter build apk it will end up like this : C:\fluttersdk\flutter\bin\flutter.bat build apk as the command.

Solution 17 - Powershell

Just adding my two cents. I had same problem and after trying everything i read, i eventually just used "echo %path%" in the command line and saw that the path of flutter contains illegal character. After deleting flutter entry in PATH and typing it again manually instead of copying it, it is finally working. Just in case it can help someone.

enter image description here

Solution 18 - Powershell

If it happened to you like it happened to me, you probably went to add flutter\bin to the environment variables by editing the Path system variable.

You then proceeded to press the Browse button, and selected your desired path.

The part you didn't expect was that it actually overwrote the %SYSTEMROOT%\System32 entry, which is the first path in the list, and the path which becomes highlighted by default when you open that edit window.

If this is the case for you, simply press the New button, and add %SYSTEMROOT%\System32 back into the Path variable, which should make where.exe available again.

The thing to note here is that the Browse button in the Path variables edit window, will overwrite the highlighted path with the newly selected path, so it is important to make sure none of the existing paths are highlighted when using it.

Solution 19 - Powershell

I really see a big mess here; however the solution is very simple. Even no restart needed.

To my case I saved the flutter folder in my account's source folder and I appended this value in the PATH entry;

%USERPROFILE%\source\flutter\bin

Note: I only had one value and it was for Microsoft WindowsApps (;

Explanation

Now, we all know that we need to append "the full path to flutter\bin" in the PATH entry or create a new one if it doesn't exist. However, Windows users have different profile folders thus our case for the full path. So to solve this common problem whatever was the typical path for the user's profile folder, we can use %USERPROFILE% value which is a Constant special item ID list (CSIDL). See Recognized Environment Variables

>Constant special item ID list (CSIDL) values provide a way to identify folders that applications use frequently but may not have the same name or location on any given computer.

So if you saved the Flutter folder, like me, in the user's profile folder, Just copy %USERPROFILE% and paste it before the flutter's bin folder directory in the PATH entry and then append all to the existing values using ; as a separator or similarly click the New button on the right side of the panel and paste it.

Solution 20 - Powershell

I tried setting absolute paths for 'System32' and 'PowerShell' but it didn't work. Finally, it was solved after setting the path as follows.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionmaaoui karimView Question on Stackoverflow
Solution 1 - PowershellMahesh JamdadeView Answer on Stackoverflow
Solution 2 - PowershellNadun KulatungeView Answer on Stackoverflow
Solution 3 - PowershellExceptionView Answer on Stackoverflow
Solution 4 - PowershellAmit KumarView Answer on Stackoverflow
Solution 5 - PowershellAlexandre JeanView Answer on Stackoverflow
Solution 6 - PowershelldeveloperSumitView Answer on Stackoverflow
Solution 7 - PowershellSeverin KlugView Answer on Stackoverflow
Solution 8 - PowershellanggadazView Answer on Stackoverflow
Solution 9 - PowershellVinniePazView Answer on Stackoverflow
Solution 10 - PowershellT.BinyamView Answer on Stackoverflow
Solution 11 - PowershellRoCk RoCkView Answer on Stackoverflow
Solution 12 - PowershellRahul SharmaView Answer on Stackoverflow
Solution 13 - PowershellDanielView Answer on Stackoverflow
Solution 14 - PowershellMetallerView Answer on Stackoverflow
Solution 15 - PowershellkirkadevView Answer on Stackoverflow
Solution 16 - PowershellcrushmanView Answer on Stackoverflow
Solution 17 - PowershellAlon LaviView Answer on Stackoverflow
Solution 18 - PowershellcuzoxView Answer on Stackoverflow
Solution 19 - PowershellStudentView Answer on Stackoverflow
Solution 20 - Powershellchk.buddiView Answer on Stackoverflow