Resolve Flutter Doctor Dart Path Warning on macOS
Problem Statement
When running flutter doctor
on macOS after Flutter installation, you may encounter this warning:
! 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:
- Conflicting Dart installations: You have a separate Dart SDK installed (e.g., via Homebrew) alongside Flutter's bundled Dart SDK
- Incorrect PATH order: Your system's PATH prioritizes the standalone Dart installation over Flutter's version
- Case sensitivity issues: macOS paths are case-sensitive (e.g.,
Users
vsusers
) - Outdated configurations: PATH variables may reference older Flutter installations
Recommended Solutions
1. Uninstall Standalone Dart SDK (Preferred Method)
IMPORTANT
Flutter includes a compatible Dart SDK - separate installations cause conflicts
# Uninstall Dart SDK via Homebrew
brew uninstall dart
brew uninstall dart-sdk # For older installations
After uninstalling:
flutter doctor -v # Verify warnings are resolved
2. Correct Your PATH Configuration
If you need multiple Dart versions, adjust your PATH:
- Open your shell configuration file:
nano ~/.zshrc # Default for macOS Catalina+
# or
nano ~/.bash_profile # Older macOS versions
- Add the Flutter path before other Dart paths:
export PATH="/Users/yourname/development/flutter/bin:$PATH"
- Case sensitivity check - ensure path case matches your actual directory:
- export PATH="/users/name/flutter/bin:$PATH"
+ export PATH="/Users/name/flutter/bin:$PATH"
- Apply changes:
source ~/.zshrc # or source ~/.bash_profile
3. Resolve Directory Name Mismatches
Rename directories to exactly match your PATH configuration:
# Original (causes conflict)
/Users/name/Development/flutter
# Fixes case sensitivity issues
mv ~/Development/flutter ~/development/flutter
Verification and Common Cases
Confirm correct configuration:
which flutter # Should show your Flutter path
which dart # Should point INSIDE Flutter directory
Case | Solution |
---|---|
Installed via Homebrew | brew uninstall dart |
PATH incorrectly ordered | Update .zshrc /.bash_profile |
Directory case mismatch | Rename directories or correct PATH |
Windows PATH conflicts | Remove standalone Dart from environment variables |
PRO TIP
After making changes, restart your terminal or run source ~/.zshrc
before checking flutter doctor