The term ‘flutter’ is not recognized as the name of a cmdlet, function, script file, or operable program
The error message “The term ‘flutter’ is not recognized as the name of a cmdlet, function, script file, or operable program” indicates that Flutter is not properly set up in your system’s PATH environment variable. To fix this, you need to add the Flutter SDK’s bin
directory to your PATH.
Here’s how you can do this on Windows:
- Locate Flutter SDK:
- Find the directory where you have installed the Flutter SDK. For example, if you extracted the Flutter SDK to
C:\src\flutter
, then your Flutter SDK path isC:\src\flutter
.
- Find the directory where you have installed the Flutter SDK. For example, if you extracted the Flutter SDK to
- Add to PATH:
- Open the Start menu and search for “Environment Variables.” Click on “Edit the system environment variables.”
- In the System Properties window, click on “Environment Variables…”
- Under “System Variables,” find the variable named “Path” and select it. Click on “Edit…”
- In the “Edit Environment Variable” window, click on “New” and add the path to the Flutter SDK’s
bin
directory. For example, if your Flutter SDK is inC:\src\flutter
, addC:\src\flutter\bin
. - Click “OK” to close each of the open windows.
- Restart Terminal:
- Close and reopen your terminal or command prompt.
- Verify Installation:
- Run the command
flutter --version
to verify that Flutter is now recognized.
- Run the command
Once you have added Flutter to your PATH, you should be able to run the flutter pub get
command successfully in your project directory.