i also faced the same issue on a Windows machine. I figured out that installing the Firebase CLI using the binary file didn't work for me (even after @ventosus's answer), so here is my solution:
I had to install the Firebase CLI using the npm command (Node.js is required to use this command):
npm install -g firebase-tools
Then, I was able to run the command:
flutterfire configure
The error message "FirebaseCommandException: An error occurred on the Firebase CLI when attempting to run a command" typically indicates an issue with executing a command using the Firebase Command Line Interface (CLI). This could be due to various reasons such as authentication issues, network problems, or misconfiguration.
npm install -g firebase-tools
.firebase login
and following the authentication prompts.npm install -g firebase-tools
.After applying the above steps and resolving any issues with Firebase CLI configuration, retry the command to see if the error persists.
I encountered the same problem. I downloaded the CLI binary and set an alias:
alias firebase=$HOME/devel/toolkits/firebase/firebase-tools-linux
proj$ firebase --version
11.15.0
proj$ flutterfire configure
I Found 0 Firebase projects.
FirebaseCommandException: An error occurred with the Firebase CLI when attempting to run a command.
COMMAND: firebase --version
ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed. See https://firebase.google.com/docs/cli#install_the_firebase_cli for instructions on how to install it.
My temporary solution: (creating a symlink in the PATH)
proj$ ln -s $HOME/devel/toolkits/firebase/firebase-tools-linux $HOME/bin/firebase
What worked for me was to enable scripts to run by setting the PowerShell execution policy, as this was preventing me from running scripts.
Open PowerShell as an administrator.
Run the command:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
It works only in the Command Prompt (not PowerShell or the Node.js runtime): Microsoft Windows
Run:
firebase logout
Then:
firebase login
i also faced the same issue on a Windows machine. I figured out that installing the Firebase CLI using the binary file didn't work for me (even after @ventosus's answer), so here is my solution:
I had to install the Firebase CLI using the npm command (Node.js is required to use this command):
npm install -g firebase-tools
Then, I was able to run the command:
flutterfire configure