Home > Enterprise >  MacOS gives zsh: command not found: flutter after updating path according to Flutter
MacOS gives zsh: command not found: flutter after updating path according to Flutter

Time:06-16

Recently I updated Mac OS to latest Catalina and my terminal which is using zsh now start showing me following error:

zsh: command not found: flutter

It was working fine before update

CodePudding user response:

First of all, I suggest using FVM (Flutter Version Management). Which is a great tool, that can be used to install and switch between Flutter versions easily.

https://fvm.app

Concerning zsh, you could create a file named ~/.zshenv where you can configure path variables. It works a bit differently than with bash.

#!/bin/zsh

# makes path an array with unique elements
typeset -U path

# adds flutter to the path
path =('/Users/XXX/Tools/FVM/default/bin')

# adds global dart packages to the path
path =('/Users/XXX/.pub-cache/bin')

export PATH

As you can see, I use Flutter with FVM, but you can of course just download Flutter yourself and provide the path in the .zshenv file. After changing the file you may want to run source ~/.zshenv, to make the changes available in the running terminal session.

  • Related