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

10,377

Solution 1

try :

pub global run fvm:main

pub global run fvm:main use VERSION

Solution 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

Share:
10,377
Jay Mungara
Author by

Jay Mungara

A passionate app developer. I'm learning new programming things and exploring coding fundamentals to grow my computational skills. I'm 63rd person to earn flutter technology silver badge I'm 71st person to earn flutter technology bronze badge. I'm 125th person to earn dart technology bronze badge.

Updated on June 17, 2022

Comments

  • Jay Mungara
    Jay Mungara almost 2 years

    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.

    • Abhilash Chandran
      Abhilash Chandran almost 4 years
      Hope you activated the package, using pub global activate fvm
    • Jay Mungara
      Jay Mungara almost 4 years
      Yes i did it already.
    • Abhilash Chandran
      Abhilash Chandran almost 4 years
      Here are the options I would try. 1. If you are in windows 10 you can try refreshenv. 2. If you are using android studio closing the terminal and restarting by invalidating and clearing the cache could help. 3. Also you can try running like pub global list to make sure it contains fvm.
    • Abhilash Chandran
      Abhilash Chandran almost 4 years
      Maybe silly but make sure C:\Users\User\AppData\Roaming\Pub\Cache\bin; user in this path refers to your username. :)
    • Jay Mungara
      Jay Mungara almost 4 years
      Yes did it as well
  • Minh Nguyen
    Minh Nguyen almost 3 years
    Why fvm command not work in VSCode, but work in the terminal application?
  • fatiu
    fatiu almost 3 years
    Vscode terminal has probably not refreshed. You do source ~/.bashrc or source ~/.zshrc to refresh