Skip to content

Resolve Flutter Doctor Dart Path Warning on macOS

Problem Statement

When running flutter doctor on macOS after Flutter installation, you may encounter this warning:

text
! Warning: `dart` on your path resolves to
/usr/local/Cellar/dart/2.19.1/libexec/bin/dart, which is not inside your
current Flutter SDK checkout at /Users/[user]/development/flutter.
Consider adding /Users/[user]/development/flutter/bin to the front of your path.

This warning occurs because:

  1. Conflicting Dart installations: You have a separate Dart SDK installed (e.g., via Homebrew) alongside Flutter's bundled Dart SDK
  2. Incorrect PATH order: Your system's PATH prioritizes the standalone Dart installation over Flutter's version
  3. Case sensitivity issues: macOS paths are case-sensitive (e.g., Users vs users)
  4. Outdated configurations: PATH variables may reference older Flutter installations

1. Uninstall Standalone Dart SDK (Preferred Method)

IMPORTANT

Flutter includes a compatible Dart SDK - separate installations cause conflicts

bash
# Uninstall Dart SDK via Homebrew
brew uninstall dart
brew uninstall dart-sdk  # For older installations

After uninstalling:

bash
flutter doctor -v  # Verify warnings are resolved

2. Correct Your PATH Configuration

If you need multiple Dart versions, adjust your PATH:

  1. Open your shell configuration file:
bash
nano ~/.zshrc  # Default for macOS Catalina+
# or
nano ~/.bash_profile  # Older macOS versions
  1. Add the Flutter path before other Dart paths:
bash
export PATH="/Users/yourname/development/flutter/bin:$PATH"
  1. Case sensitivity check - ensure path case matches your actual directory:
diff
- export PATH="/users/name/flutter/bin:$PATH"
+ export PATH="/Users/name/flutter/bin:$PATH"
  1. Apply changes:
bash
source ~/.zshrc  # or source ~/.bash_profile

3. Resolve Directory Name Mismatches

Rename directories to exactly match your PATH configuration:

bash
# Original (causes conflict)
/Users/name/Development/flutter

# Fixes case sensitivity issues
mv ~/Development/flutter ~/development/flutter

Verification and Common Cases

Confirm correct configuration:

bash
which flutter  # Should show your Flutter path
which dart     # Should point INSIDE Flutter directory
CaseSolution
Installed via Homebrewbrew uninstall dart
PATH incorrectly orderedUpdate .zshrc/.bash_profile
Directory case mismatchRename directories or correct PATH
Windows PATH conflictsRemove standalone Dart from environment variables

PRO TIP

After making changes, restart your terminal or run source ~/.zshrc before checking flutter doctor