'flutter' is not recognized as an internal or external command

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
3 min

banner

# 'flutter' is not recognized as an internal or external command

The error "'flutter' is not recognized as an internal or external command, operable program or batch file" occurs for 2 main reasons:

  1. Not having the path to flutter added to your user's PATH environment variable.
  2. Not having flutter installed on your machine.

flutter is not recognized as internal or external command

If you don't have flutter installed, scroll down to the next subheading.

To solve the error if you have flutter installed:

  1. Click on the Search bar and type "environment variables".
  2. Click on "Edit the system environment variables".

edit system environment variables

  1. Click on the "Environment Variables" button.

click environment variables

  1. In the "User variables for YOUR_USER" section, select the "Path" variable and click "Edit".

select user path click edit

  1. You can either click "New" and then "Browse" and navigate to the path where flutter\bin is located or paste it directly.

click new browse

The flutter documentation recommends storing the flutter directory at C:\src\flutter.

Assuming you used the same path, you would have to add the path to C:\src\flutter\bin.

Note that the path points to flutter\bin, not to flutter.

cmd
C:\src\flutter\bin

We are looking for the directory that contains the flutter.bat file.

path to flutter bin

Make sure that you also have the path C:\Windows\System32 in your PATH environment variable.

cmd
C:\Windows\System32

added paths

  1. Once the two paths are added, confirm the changes by clicking on the "OK" button twice.

  2. Close your Command prompt application and then reopen it.

Note that you must restart your Command prompt shell for the changes to take effect.

You might also have to restart your PC, but that's not always necessary.

Open a new Command Prompt and run the flutter doctor command to make sure everything works as expected.

cmd
flutter doctor

flutter command works

If the error persists, follow the step-by-step installation guide from the next subheading.

# Using the official installer to install and configure flutter

To install and configure flutter on Windows:

  1. Download the Flutter SDK zip file for Windows.

download flutter installer windows

  1. Right-click on the file and extract it.

extract flutter archive

  1. Copy the flutter folder to C:\src\flutter.

copy flutter folder to c src flutter

  1. Click on the Search bar and type "environment variables".
  2. Click on "Edit the system environment variables".

edit system environment variables

  1. Click on the "Environment Variables" button.

click environment variables

  1. In the "User variables for YOUR_USER" section, select the "Path" variable and click "Edit".

select user path click edit

  1. You can either click "New" and then "Browse" and navigate to the path where flutter\bin is located or paste it directly.

click new browse

The flutter documentation recommends storing the flutter directory at C:\src\flutter.

Assuming you used the same path, you would have to add the path to C:\src\flutter\bin.

Note that the path points to flutter\bin, not to flutter.

cmd
C:\src\flutter\bin

We are looking for the directory that contains the flutter.bat file.

path to flutter bin

Make sure that you also have the path C:\Windows\System32 in your PATH environment variable.

cmd
C:\Windows\System32

added paths

  1. Once the two paths are added, confirm the changes by clicking on the "OK" button twice.

  2. Close your Command prompt application and then reopen it.

Note that you must restart your Command prompt shell for the changes to take effect.

You might also have to restart your PC, but that's not always necessary.

Open a new Command Prompt and run the flutter doctor command to make sure everything works as expected.

cmd
flutter doctor

flutter command works

# Conclusion

To solve the error "'flutter' is not recognized as an internal or external command, operable program or batch file", make sure:

  1. You have the path to flutter added to your user's PATH environment variable.
  2. You have flutter installed on your machine.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.