flutterdartfvmmelos

how to run "melos bootstrap" command with fvm


Currently on my computer installed Flutter version 3.3, but my project works on 2.5.3 So I'm using fvm for that, I've set up everything, but when I run melos bootstrap, I think it's just running command "flutter pub get" instead of "fvm flutter pub get"

How to fix that?


Solution

  • The answer of Matt Larsuma is correct but if you work in a team and the other colaborators doesn't use fvm, you probably won't want to set this config on your repository.

    So to avoid this, you can just add an argument to melos CLI command that can set the SDK version that it needs to look for.

    Example:

    melos clean --sdk-path .fvm/flutter_sdk
    melos bootstrap --sdk-path .fvm/flutter_sdk
    melos pub-run:all --sdk-path .fvm/flutter_sdk