'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.
Solution 1:[1]
try :
pub global run fvm:main
pub global run fvm:main use VERSION
Solution 2:[2]
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
Solution 3:[3]
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
Solution 4:[4]
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.
Solution 5:[5]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mhmd Zawi |
| Solution 2 | cerberodev |
| Solution 3 | Youssri Abo Elseod |
| Solution 4 | Mirzo-Golib |
| Solution 5 | Elmar |


