Introduction

Whether you are building cross-platform apps with Flutter or writing standalone server-side scripts, configuring your dart path in windows 11 is a foundational step. Without a properly configured environment path, your Command Prompt, PowerShell, or terminal in VS Code won't recognize the dart executable command globally.

In this guide, we will walk through the exact steps to locate your Dart SDK and configure the system PATH environment variable in Windows 11 using both the graphical user interface (GUI) and PowerShell command-line instructions.

Note for Flutter Developers: If you have already installed the Flutter SDK, the Dart SDK comes bundled with it located in C:\src\flutter\bin\cache\dart-sdk\bin (or your custom Flutter path). Alternatively, adding C:\src\flutter\bin directly to your PATH exposes both flutter and dart CLI tools.

Step 1: Locate Your Dart SDK Binary Directory

Before modifying system variables, locate the absolute folder path containing dart.exe. Common installation locations include:

  • Bundled with Flutter: C:\flutter\bin or C:\src\flutter\bin\cache\dart-sdk\bin
  • Installed via Chocolatey: C:\tools\dart-sdk\bin
  • Manual Zip Extraction: C:\Program Files\dart-sdk\bin

Ensure that opening this folder reveals dart.exe inside it.

Step 2: Add Dart Path to Windows 11 Environment Variables (GUI)

Follow these steps to update your PATH environment variable using the standard Windows 11 interface:

  • Press Win + S to open Windows Search, type env, and select Edit the system environment variables.
  • In the System Properties dialog, click the Environment Variables... button at the bottom right.
  • Under the User variables for [YourUsername] section (or System variables for all system users), select the Path variable and click Edit....
  • Click New on the right pane and paste the absolute path to your Dart bin folder (e.g., C:\tools\dart-sdk\bin).
  • Click OK on all open windows to apply and save changes.

Step 3: Alternative — Set Dart Path via PowerShell

If you prefer using the command line, you can add the Dart path to your User Environment PATH using PowerShell. Open PowerShell as Administrator and run the following command:

Code
# PowerShell command to append Dart SDK path to User PATH
$dartPath = "C:\tools\dart-sdk\bin"
$oldPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (-not $oldPath.Split(';').Contains($dartPath)) {
    [Environment]::SetEnvironmentVariable("Path", "$oldPath;$dartPath", "User")
    Write-Host "Dart path successfully added to environment variables."
} else {
    Write-Host "Dart path already exists in environment variables."
}

Step 4: Verify the Dart Environment Path Configuration

To confirm that your dart path in windows 11 is configured properly, open a fresh PowerShell or Command Prompt terminal and check the installed Dart version:

Code
# Run in PowerShell or Command Prompt
dart --version

If successfully configured, the command returns the installed Dart SDK version details. You can now create and run a simple Dart program directly from your command line:

Code
// main.dart
void main() {
  final String message = 'Dart environment path is fully configured on Windows 11!';
  print(message);
}

Execute the program using the command:

Code
dart run main.dart

Troubleshooting Common Path Issues

  • 'dart' is not recognized as an internal or external command: Restart your terminal or IDE. Environment variable changes apply only to newly launched shell windows.
  • Conflicting Dart Versions: If you have both a standalone Dart SDK and a Flutter SDK installed, system PATH precedence depends on whichever directory appears higher in your Environment Variables list. Move your preferred path higher up using the Move Up button in the Environment Variables editor.

Frequently Asked Questions

How do I verify if the Dart path in Windows 11 is set correctly?

Open a new PowerShell or Command Prompt window and execute 'dart --version'. If the Dart version appears without errors, your path is set up correctly.

Is the Dart SDK included automatically with the Flutter SDK?

Yes, Flutter includes the full Dart SDK inside its directory under bin/cache/dart-sdk. Adding the Flutter bin path to your system PATH automatically gives you access to Dart.

Why is 'dart' not recognized after updating system environment variables?

Existing terminal windows, VS Code instances, or Android Studio terminals retain older session environment states. Close and reopen your terminal or code editor to load the updated PATH variable.

Should I add the Dart path to User variables or System variables?

Adding it to User variables affects only your logged-in Windows account, which is recommended for single-user setups. Adding it to System variables makes Dart accessible to all user accounts on the machine.