How to Use FVM (Step-by-Step Guide)

Apr 15, 2025 · 1 min read · 180 Words · -Views -Comments · Programming
移动开发 软件推荐 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

When there are many Flutter projects, you also face the same multi-version environment maintenance issues as Node.js projects. Fortunately, there’s a similar product called FVM. Here’s a simple introduction.

Installation

brew install fvm

Install a Specific Version

fvm install 3.19.2

Note that after installation, fvm list will show that dart and other modules are not installed, but prompt that configuration is needed. This will only install when actually used, i.e., fvm use.

Use a Specific Version

fvm use

After using, you’ll find that the actual installation begins. After installation is complete, re-executing list will show the dart version information.

Generate FVM Configuration for Project

fvm use *** --save

Note that after save, the project configuration will be generated, and you can use fvm use directly afterwards.

Global Package Version Setting

Sometimes for convenience, you need to set a global version so you don’t have to use fvm commands every time. The specific setting method is as follows.


# Configure PATH in zshrc
export PATH="$HOME/fvm/default/bin:$PATH"

# Set global version
fvm global

# Cancel global version
fvm global -u
Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover