Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command how to remove global version #619

Closed
tenhobi opened this issue Feb 15, 2024 · 6 comments · Fixed by #641
Closed

Add a command how to remove global version #619

tenhobi opened this issue Feb 15, 2024 · 6 comments · Fixed by #641
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tenhobi
Copy link

tenhobi commented Feb 15, 2024

There is a command fvm global to configure one version as global, but there is no legit way how to disable global version completely. One can only remove ~/fvm/default.

So something like fvm global --disable or so would be nice.

@tenhobi tenhobi added the enhancement New feature or request label Feb 15, 2024
@leoafarias
Copy link
Owner

@tenhobi The only way to disable the global would be to change your PATH to not point to fvm/default I think this might cause an error and the user won't know why.

Any suggestions?

@tenhobi
Copy link
Author

tenhobi commented Feb 16, 2024

Well as I user I should be able to somehow disable the global Flutter via FVM version. For example so I am sure I use the local Flutter version everywhere correctly. For example, Melos now probably does not work with local FVM (their sdkPath option) and testing if it works with global Flutter was one way how to make that work temporarily.

Disabling the global FVM is also possible by removing fvm/default, even tho this stays in PATH (and if it does have something that does not exists, it's basically the same as not being present, no) -- at least thats what I did locally to disable global.

@leoafarias
Copy link
Owner

@tenhobi I'm not entirely sure I understand. We could create a command to disable global, but if you have the path configured anywhere else, it will just result in an error. However, in the case of vscode, it checks different levels of configuration, so it might handle the check if the path does not exist.

Is the workflow you are checking is running flutter command on a new terminal outside of vscode?

@tenhobi
Copy link
Author

tenhobi commented Feb 16, 2024

The issue I am talking about is with melos right now invertase/melos#616. My colleague installed fvm for the first time and had issues, I wanted to test it on my machine and therefore I wanted to disable fvm global just to discover I cannot do that using the CLI.

Of course I can disable it manually, if I have the knowledge about it being in PATH etc. and if I find the file where FVM put it to PATH etc.

But maybe you are right, its really hard to remove PATH add and make it less error prone. Maybe adding a note to docs would be enough?

@leoafarias
Copy link
Owner

Thanks for linking the issue; I will take a look. There is a command fvm exec https://fvm.app/documentation/guides/basic-commands#exec; this injects the fvm SDK into the flutter path for that command. See if that resolves, at least temporarily.

@leoafarias
Copy link
Owner

@tenhobi, one more thing to help me with. Are you using the latest version of FVM? When you run the use command, it should complain about being unable to resolve Melos if it's incompatible with the Dart SDK version, like the error below.

Can't load Kernel binary: Invalid kernel binary format version.
melos 4.1.0 doesn't support Dart 2.14.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants