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

21

66

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

Smedley answered 2/4, 2018 at 10:52 Comment(6)
Did you set the environment variable correctly?Wardlaw
take a look at this videoAntoinette
Screenshot pleaseYearn
yeah i have set the environment variable correctly and yet it doesn't work, i have took a look at the video and i just followed the steps correctly yet it doesn't workSmedley
What is the path you set for the environment variable?Wardlaw
i used flutter\bin as mentionned in the flutter page but here he is recognizing flutter as a command but dosnt recognize the rest i thinkSmedley
S
41

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

Sheppard answered 25/11, 2018 at 6:57 Comment(1)
Step # 3 wasn't necessary in my case. However, I also needed to add C:\Windows\System32\WindowsPowerShell\v1.0 in System Variable path.Delano
W
35

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)

Wardlaw answered 2/4, 2018 at 11:39 Comment(5)
What is the path you set for the environment variable?Wardlaw
This one really helped. I changed my default flutter SDK path (environment variables -PATH) from "F:\Microsoft VS Code\bin" to my SDK path -- "C:\flutter\bin". And it works.Becalm
Note helped me. ThanksEnervated
Reboot is very important. After updating the pathConcentrate
Thanks a lot for this man really was stuck on this for very long.Nostradamus
T
28

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

Trefor answered 6/4, 2018 at 9:48 Comment(0)
J
11

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

Jennyjeno answered 13/8, 2018 at 9:9 Comment(0)
A
7

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.

Afterbrain answered 11/7, 2018 at 1:3 Comment(1)
I second this. I tried everything: adding System32 & Git to PATH but at User Variables level, restarting, reinstalling Git & Flutter & Graddle. Nothing but adding Flutter to Systerm Variables worked.Selfdrive
S
6

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.

Satin answered 7/10, 2019 at 10:58 Comment(0)
T
5

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.

Tutor answered 15/8, 2019 at 7:49 Comment(1)
Thanks, my antivirus was deleting all files in bin folder, i disabled it and run again. It worked now.Insurgence
D
4

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.

Dorene answered 30/7, 2019 at 10:13 Comment(1)
Remove spaces before and after each path!Satiable
A
4

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.

Alemanni answered 16/8, 2021 at 10:30 Comment(1)
just dont forget to restart the CMD after adding the path in system variableAdamec
S
3

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.

Soni answered 4/10, 2019 at 19:11 Comment(0)
S
2

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.

Scaramouch answered 26/4, 2018 at 8:7 Comment(0)
L
2

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.

Luge answered 22/7, 2018 at 13:38 Comment(0)
M
2

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.

Mousey answered 7/5, 2019 at 3:33 Comment(0)
S
2

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\
Satiable answered 4/8, 2020 at 5:16 Comment(0)
B
1

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.

Beleaguer answered 11/7, 2018 at 10:29 Comment(1)
This isn't a proper answer to this question.Campfire
C
1

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

Causalgia answered 29/10, 2020 at 11:27 Comment(0)
V
0

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

Vocal answered 5/6, 2019 at 10:33 Comment(0)
R
0

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.

Robot answered 6/1, 2020 at 5:26 Comment(0)
C
0

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.

Cockrell answered 10/5, 2020 at 17:56 Comment(0)
B
0

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

Barta answered 22/11, 2020 at 13:35 Comment(0)
P
0

In My case, I type command flutter pub get in terminal it works for me

Primate answered 26/9, 2022 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.