我使用的是Ubuntu 20.04。我安装了fvm和flutter。当我安装了Flutter SDK的两个版本(稳定版和1.22.0版)时,它们都安装得很顺利。然后我将稳定版本设置为全局。但是,当我这样做时,它向我显示了以下警告:
Flutter“稳定”已设置为全局,但您的"flutter“路径当前指向:
/snap/bin
to use global Flutter SDK through FVM you should change it to:
/home/khamidjon/fvm/default/bin如果您能帮助我解决这个问题,我将不胜感激。

发布于 2021-10-14 09:44:54
现在回答有点晚了。我正在使用MacOS。为了让任何终端都能理解Flutter SDK的位置,我需要做一些配置。因此,为了使用FVM (Flutter Version Manager),我需要再次调整它们。
步骤太多了,不用担心。我只是想把它们写得尽可能清楚。这很简单。下面是我是如何做到的:
1. Open a new terminal.
2. Go to the upmost directory by using command: cd
3. Type 'ls -la' to list all the files and directories.
4. You should see this file named exactly: .bashrc
If you can't you should see another one: .zshrc
5. Open this file using vim (it's an editor. You can research about it but for now, we keep things simple)
So type:
vim .bashrc
6. Actually, it is a built-in editor. It works a bit differently. You need some basic commands.
7. Press "i" key to change into INSERT mode of vim editor.
8. Now, you can type or delete text. You should make the corresponding changes. So make sure this line exist. (You can comment out other lines that by "#").
I had the Flutter SDK like that before:
export PATH=$PATH:"/Users/your-username-here/another-folder-maybe/flutter/bin"
So I commented that line out and inserted this:
export PATH=$PATH:"/Users/your-username-here/fvm/default/bin"
9. Now, you should quit the INSERT mode. For that, I use "Control + C" keybinding on Mac. It might be different for you, check that out on the internet.
10. Then, let's save the changes and quit vim editor by typing exactly
:wq
11. Now you are all set. Important, you have to restart the terminal. Try the fvm command again and you should be able to set the global version without an error.https://stackoverflow.com/questions/67806355
复制相似问题