When i run: flutter pub global list i get: fvm 2.4.1

but when i run fvm i get the error: Cannot find file at '..\lib\fvm\bin\fvm.exe' (C:\ProgramData\chocolatey\lib\fvm\bin\fvm.exe). This usually indicates a missing or moved file.

i have tried running some commands on the cmd: flutter pub cache clean flutter pub global deactivate fvm flutter pub global activate fvm still nothing works

Also when i locate the folder on the path above, the fvm\bin is empty

What could be the problem

2

There are 2 best solutions below

2
On

The point is that you tried to install fvm in two ways:

  • through choco install fvm
  • through dart pub global activate fvm

Now what my recommendation is to remove your second option with:

dart pub global deactivate fvm

and try installing this package via choco. You will also need to add this location to the environment variables in path (or the location your fvm will install to):

C:\ProgramData\chocolatey\lib\fvm\bin\
0
On

Another approach to solve this is by removing the flutter environment variable before installing it.

Remove the C/src/flutter from the Path. And reinstall the fvm again.