Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Terminal says fvm: command not found after installing FVM

Error-bash: fvm: command not found

Short answer

The shell cannot find an fvm executable. Either FVM was never installed, or you installed it with dart pub global activate and the pub cache bin folder, $HOME/.pub-cache/bin on macOS and Linux, is not on your PATH. Install it with Homebrew or pub, then add that folder to PATH and open a new terminal.

  • Applies to FVM 4, Dart 3.9, macOS, Linux
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find out whether the executable exists anywhere and whether the pub cache folder is on your PATH.

    ls "$HOME/.pub-cache/bin"
    echo "$PATH" | tr ':' '\n' | grep pub-cache
  2. 2Match what you see, then jump to its fix

    1. 1ls shows an fvm file in .pub-cache/bin, but the second command prints nothingFVM was installed with pub, but the pub cache bin folder is not on PATHFix
    2. 2ls: cannot access the .pub-cache/bin folder, or it has no fvm fileFVM is not installed at allFix

What does the error look like?

  • -bash: fvm: command not found
  • zsh: command not found: fvm

Cause 1 of 2

FVM was installed with pub, but the pub cache bin folder is not on PATH

1Check

An activated Dart package only runs by name when the pub cache bin directory is in PATH. Confirm that the folder is missing from the list.

echo $PATH

2Fix

Add the folder to the startup file of your shell (for example ~/.zshrc or ~/.bashrc), then open a new terminal. On Windows the folder is %LOCALAPPDATA%\Pub\Cache\bin.

echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.zshrc
source ~/.zshrc

3Verify

The command now resolves to the pub cache copy.

which fvm
fvm --version

Confirmed by dart.dev

Did this fix it?

Cause 2 of 2

FVM is not installed at all

1Check

Search for the package in the global pub list. An empty result means it was never activated.

dart pub global list

2Fix

Install it with one of the two methods on the project's pages: Homebrew (brew install fvm), or pub. After the pub route, apply the PATH fix above.

brew install fvm
# or
dart pub global activate fvm

3Verify

Open a new terminal and ask for the version.

fvm --version

Confirmed by pub.dev

Did this fix it?

How do I stop it coming back?

  • Put the pub cache bin folder on PATH once, in your shell startup file, so every global Dart tool works.
  • Prefer one install method for FVM and note it in the project README.
  • After editing a startup file, open a new terminal or run source on the file.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.