flutterfire configure fails in the terminal with command not found
zsh: command not found: flutterfireShort answer
FlutterFire CLI is a Dart tool installed separately. zsh can only find it when it was installed with dart pub global activate and the pub cache bin folder is on your PATH. Install it, add $HOME/.pub-cache/bin to PATH, open a new terminal, or run it through dart pub global run until PATH is fixed.
Fix it fast
1Find out which cause you have
Look inside the pub cache bin folder. If a flutterfire file is there, the tool is installed and the problem is PATH. If the folder is empty or missing, the tool was never installed.
ls "$HOME/.pub-cache/bin" echo "$PATH" | tr ':' '\n' | grep pub-cache2Match what you see, then jump to its fix
- 1
ls shows no flutterfire file in the pub cache bin folder, or the folder does not existFlutterFire CLI was never installed on this machineFix - 2
The file exists in $HOME/.pub-cache/bin, but typing flutterfire still gives command not found, and the grep in the first step prints nothingThe pub cache bin folder is not on PATHFix
- 1
What does the error look like?
zsh: command not found: flutterfireflutterfire: command not found
Cause 1 of 2
FlutterFire CLI was never installed on this machine
1Check
The Firebase setup guide for Flutter lists the CLI as a separate install step. The Firebase guide installs it with dart pub global activate.
ls "$HOME/.pub-cache/bin"2Fix
Install the CLI once from any directory, using the command from the Firebase guide.
dart pub global activate flutterfire_cli3Verify
A flutterfire file now exists in the pub cache bin folder.
ls "$HOME/.pub-cache/bin"Confirmed by firebase.google.com
Cause 2 of 2
The pub cache bin folder is not on PATH
1Check
Dart installs global tools into the pub cache bin directory, which is $HOME/.pub-cache/bin on macOS and Linux. The shell only runs programs from folders listed in PATH.
echo "$PATH" | tr ':' '\n'2Fix
Add the folder to PATH in your zsh startup file, then start a new terminal window so the change is read. Until then you can run the tool without PATH by naming the package and executable.
echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.zshrc
source ~/.zshrc
# works without any PATH change
dart pub global run flutterfire_cli:flutterfire configure3Verify
The shell now resolves the command.
command -v flutterfireConfirmed by dart.dev
How do I stop it coming back?
- Put the pub cache bin line in ~/.zshrc once, so every new terminal and IDE terminal gets it.
- Run flutterfire configure from the Flutter project folder, not from your home directory.
- Re-run flutterfire configure when you add a platform or a new Firebase product, as the Firebase guide advises.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.
Related fixes
Mobile apps
AudioCache has no play method after updating audioplayers
The method 'play' isn't defined for the type 'AudioCache'.
Since audioplayers 1.0, AudioCache only turns asset files into local files and caches them.
2 causes, each with a fixMobile apps
Flutter Bloc throws that emit was called after the event handler completed
emit was called after an event handler completed normally.
Each on<Event> handler gets its own Emitter, and it stops working the moment the handler's returned Future completes.
2 causes, each with a fixMobile apps
analysis_options.yaml: the URI it includes can't be found
include_file_not_found
The analyzer reports include_file_not_found when the file named after include: in analysis_options.yaml does not resolve.
2 causes, each with a fixMobile apps
Dart error: the body might complete normally and return null for a non-nullable type
body_might_complete_normally
Dart found a path through your function or callback that reaches the closing brace without a return.
3 causes, each with a fixMobile apps
Dart throws ConcurrentModificationError while looping over a list
ConcurrentModificationError
Dart throws this when a collection changes size while something iterates it.
2 causes, each with a fixMobile apps
Dart cannot turn a compact timestamp like 20201101153000 into a DateTime
FormatException: Invalid date format
DateTime.parse accepts a subset of ISO 8601, and a time part must be introduced by T or a space.
2 causes, each with a fix