When I try to download flutterfire_cli, my cmd crashes - flutter

I am trying to download the flutterfire_cli througth:
dart pub global activate flutterfire_cli
But when I even copy and paste this into command prompt, command prompt just crashes.

Related

Flutterfire configure error attempting to run a command

I have installed Firebase CLI, but when I run flutterfire configure in my app folder, I get the following error:
FirebaseCommandException: An error occured on 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 how to install it.
Is there anything I'm missing?
First, run the command "dart pub global activate flutterfire_cli". After running the command "dart pub global activate flutterfire_cli" you should get a warning message, you just need to add the path to the path variable. Go to the Finder in your Mac. Select "Go->Home" at the top. Inside the home page, use the keyboard shortcut (Command + Shift + .(period)) to show hidden files. Then, look for the file .zshrc. Add the path from the warning message in the zshrc file, it should look like this: export PATH="$PATH":"$HOME/.pub-cache/bin"

zsh: command not found: flutterfire

I am using Mac OS. i am trying register my project in firebase and use Crashlytics in firebase to check if any crash occurs in my app I had used
curl -sL https://firebase.tools | bash
command to install flutter tools it worked fine after that I tried to run
flutterfire configure
command but it throws
zsh: command not found: flutterfire
I know that I must set $path variable but to set path variable I don't know where is my flutter tools has installed in my Mac. kindly help me to set $PATH variable
run before dart pub global activate flutterfire_cli
Once you run the following command
dart pub global activate flutterfire_cli
you should get the following output
The output is telling you the executable is not on your path variable
export PATH="$PATH":"$HOME/.pub-cache/bin"
Either run the export command in your terminal
OR
Add the command to your .zhrc file

can't install get_cli flutter

I want to install get_cli but when running the command below, error is found
flutter pub global activate get_cli
the error
Warning: Executable "get" runs "bin/get.dart", which was not found in get_cli.
Warning: Executable "getx" runs "bin/get.dart", which was not found in get_cli.
I have entered the path below to the environment
export PATH="$PATH":"$HOME/.pub-cache/bin"
You can downgrade to 1.6.0 with
dart pub global deactivate get_cli
dart pub global activate get_cli 1.6.
Ref Github Issue
Explanation of error occurred due to this reason=>
// to install get_cli 1.6.0 version for proper working instead of get_cli^1.7.1
//first of all deactivate get, getx version of 1.7.1 then install get_cli ^1.6.0
Do the steps
step=1>
flutter pub global deactivate get
Step=2>
flutter pub global deactivate gets
step=3>
dart pub global activate get_cli ^1.6.0
//this will surely help you if you follow these steps
it show essay
Get CLI
Install it
You can install the package from the command line:
dart pub global activate get_cli
ya
flutter pub global activate get_cli
if you use cmd to install getcli
if you install Get_Cli using cmd thenafter installtion in cmd you show
Pub installs executables into C:\Users\USERNAME\AppData\Local\Pub\Cache\bin
that path set system variables in PATH add new PATH veriable PATH
if you use other terminal then after installesion go your file maneger
C:\Users\USERNAME\AppData\Local\Pub\Cache\bin
go and check it after copy that path and create new system verible as normal.
dart pub global activate get_cli

run shell command script in dart

Is it possible to run the terminal command in dart?
I want to run this command using custom command on the terminal.
custom command like this
dart run build-dev(build-dev is a script file)
full command in build-dev file
rm pubspec.lock && flutter clean && flutter pub get && flutter pub upgrade && flutter build apk --flavor dev -t lib/main_dev.dart
Found the answer myself.
install this package.
dart pub global activate flutter_scripts
(if you use mac os, you should setup mac shell)
you can run the same command in Flutter by using the flutter run command. Here's an example of how you can do this:
Open the pubspec.yaml file in your Flutter project.
Add a new script to the scripts section of the file:
scripts:
build-dev: flutter build apk --flavor dev -t lib/main_dev.dart
Run the script using the flutter run command:
flutter_scripts run build-dev
This will execute the flutter build apk command with the specified arguments. You can then run this script anytime by using the flutter run build-dev command.
You're asking for trouble running a dart script in a package that deletes the lock file and runs clean and pub get.
Also, pub get then pub upgrade is redundant. Just run pub upgrade.
Just make this a shell script (or batch file)!

Flutter version management. error : -bash: fvm: command not found

I am trying to install the flutter version manager to switch the flutter version among the different flutter projects.
I use the command to install the fvm - pub global activate fvm
but when I run the command on the terminal - fvm help
There is an error -bash: fvm: command not found
How to fix it ?
Your .pub-cache binaries are not yet added to your PATH variable, used by your terminal. Add path with the following command:
export PATH="$PATH:$HOME/.pub-cache/bin"
This is the location where fvm is installed. So by exporting this path to your PATH variable you should be able to get fvm working from anywhere in your terminal.
If you installed fvm using pub and you already have it in your path but you are still getting the error, follow these steps:
run dart pub cache repair // You may get an error: Failed to precompile fvm:main:. Just ignore that for now.
run dart pub global activate fvm
you can do a
flutter clean
then when its done, run
dart pub global activate fvm
when it's done it should work now, close the current bash terminal and open a new one
You must add the path to the fvm executable to the $PATH environment variable. After running "pub global activate fvm" you should have seen a warning with instructions on how to fix it. You can watch this: https://youtu.be/R6vKde1vIGQ
That will get you up and running.
if use windows 10 or later add system properties -> Environment Variables -> Path -> %USERPROFILE%\AppData\Local\Pub\Cache\bin
First confirm if fvm.bat is executing successfully, you should have the folder already in environment variable PATH(%USERPROFILE%\AppData\Local\Pub\Cache\bin). If it is then for fvm to run in bash, instead of fvm.bat, you need to create a shortcut, a file named fvm with no extension, the containing folder should also exist in PATH variable, the file contains location to fvm.bat and ends with a whitespace and S*.