can't install get_cli flutter - 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

Related

How to run an executable from flutter package without activating it globally?

I want to write a script to call flutter_gen package from CLI using fluttergen -c pubspec.yaml command. But the only way I know to do it is run dart pub global activate flutter_gen firstly.
This approach requires the user of my script to ensure that /.pub-cache/bin directory is added to PATH. To prevent such extra work, I want to find a way to run it "locally" (i.e. without global activation).
For know I use this bad workaround:
dart pub global activate flutter_gen
fluttergen -c pubspec.yaml
dart pub global deactivate flutter_gen
How can I run fluttergen -c pubspec.yaml command without dart pub global activate flutter_gen command?

Pub is not recognized as internal or external command

im trying to install the get_cli package for flutter.
install command is pub global activate get_cli, however pub is not a global variable on my windows 10 machine.
i think i need to add variables to the system environment variables, but i'm not sure what paths and how to call them.
this answer works for unix, so im looking for something similar for windows.
anyone got an idea?
edit: error: 'pub' is not recognized as an internal or external command, operable program or batch file.
If you have Flutter in C:\src\flutter, you can add path variable: C:\src\flutter\bin\cache\dart-sdk\bin (if you have Flutter in another localization, just replace the beginning of the path analogically) and restart your command line tool (or IDE).
You can add flutter prefix before pub as well: flutter pub global activate get_cli - according to flutter -h:
flutter pub - pass the remaining arguments to Dart's "pub" tool
Use dart pub not pub only and it should resolve your problem
enjoy
use flutter pub and make sure the path variable is C:\flutter\bin supposing the Flutter folder is located at C:\flutter
make sure you set the environment variables correctly.After that don't forget to restart the computer. I struggled with this issue for a long time but after doing all these things a magic code worked for me . Which you guys can also try.
dart pub global activate get_cli
then use
flutter pub global activate get_cli
this should work .

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*.

Flutter - Flutter Version Management (fvm) package not working in windows

I just added the the fvm package to switch the flutter channel from stable to master without downloading sdk components every time when switching flutter channels.
I have followed the step written in readme.md for switching the channel.
I have set the following path in my environment variables.
D:\Program_Files\FlutterSDK\SDK\flutter\bin;
D:\Program_Files\FlutterSDK\SDK\dart-sdk\bin;
C:\Users\User\AppData\Roaming\Pub\Cache\bin;
Now, i have opened my first project in which i want to use "flutter SDK's master channel". But, whenever i try to use the command "fvm use master". It's not working.
It is giving me an error like,
'fvm' is not recognized as an internal or external command,
So, can anyone suggest a solution?
Thanks.
try :
pub global run fvm:main
pub global run fvm:main use VERSION
Hi adding in your path:
%LOCALAPPDATA%\Pub\Cache\bin
More info:
https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path
In my case fvm commands did not work on Windows even tho I checked everything. It gave missing fvm.exe file and other errors. If you also stuck there you can use this way. Only way I managed to get it work is to use longer commands like these:
flutter pub global run fvm:main list
Seems like all fvm commands:
config Set configuration for FVM
flutter Proxies Flutter Commands
install Installs Flutter SDK Version
list Lists installed Flutter SDK Version
releases Lists Flutter SDK releases.
remove Removes Flutter SDK Version
use Which Flutter SDK Version you would like to use
version Prints the currently-installed version of FVM
Works like this, you just need to add the fvm command to the ending of this - flutter pub global run fvm:main. So add any of them like this form:
flutter pub global run fvm:main releases
flutter pub global run fvm:main install 2.2.0
flutter pub global run fvm:main use 2.2.0
are you add "C:\flutter\bin\cache\dart-sdk\bin" to path?
if you in windows you should run your text editor as administrator as following
In my case Error Message was
Usage Error: Flutter version null is not installed
To fix this:
I have activated FVM by pub global activate fvm;
Printed installed fvm list by fvm list, it should give result as the image below:
Selected which Flutter SDK version to use by running fvm use 1.22.0 (in my case 1.22.0, it may differ according to your desired version) command, It will download SDK if it is not installed yet;
Now you can check is flutter running in your project by running flutter;
Also, you can check if the Flutter SDK version set by calling again fvm list.
The tick means, that version is running in your project.

How to update pub package webdev for flutter web

when I try to "serve" my flutter web app
I'm getting this error:
This version of webdev does not support the build_daemon protocol
used by your version of build_runner. A newer version of webdev is
available which supports your version of the build_daemon. Please
update.
how do I update webdev ?
"pub global" seems to offer only "activate"/ "deactivate"
and "pub upgrade" is only looking into the pubspec.yaml file
any idea?
Oh... I just run "pub global deactivate " and then "pub global activate ".
Anyway I opened an issue on github suggesting to add the feature "update".
I hope this easy solution might help you,
feel free to follow up the issue.
Adding build_daemon: ^1.0.0 in dev_dependencies: of .yaml file fix my error
Do not use a global version, but use a per-project version.
To ensure running webdev on your project always works, include the version of webdev it requires in the pubspec.yaml file:
dev_dependencies:
webdev: ^2.7.9
...
And run it using:
$ dart run webdev ...
This ensures the correct version of webdev is installed when dart pub get is run, and that particular version is used for the project.
This avoids having to update the global version when things change. Running dart pub global deactivate webdev and dart pub global activate webdev is unnecessary work.
Globals are bad. Using "dart pub global activate ..." installs only one version of webdev, which may become out-of-date with your project (as you've discovered). Or you might have multiple Dart projects, and they require different versions of webdev. The above approach uses a per-project version of webdev, ensuring it is always the correct version for the project.
I got the same problem now when I followed this tutorial https://medium.com/flutter-community/flutter-create-and-deploy-a-website-from-scratch-4a026ebd6c, but I didn't get pass the error by running flutter pub global activate.
Here is what i configured in my computer
run: pub get
run: webdev serve
dev_dependencies:
build_daemon: ^1.0.0
build_runner: ^1.4.0
build_web_compilers: ^2.0.0
Wish this will fix your issues.
I had to use the following command to update webdev
flutter pub global run webdev deactivate
and then
flutter pub global run webdev activate