ZSH: command not found: flutter

ZSH: command not found: flutter

If you are an app developer, you must have heard of Flutter, an open-source mobile application development framework created by Google. Flutter allows you to build high-performance, beautiful, and natively compiled applications for mobile, web, and desktop from a single codebase.

However, while working with Flutter, you may come across an error that reads "zsh: command not found: flutter". This error can be frustrating, especially when you are in the middle of developing your app. In this article, we will explore what this error means and how you can troubleshoot it.

What is "zsh: command not found: flutter" Error?

If you receive the error message "zsh: command not found: flutter", it means that the zsh shell does not recognize the flutter command. To fix this, you can try the following steps:

  1. Check if you have installed the Flutter SDK properly on your machine. If not, follow the instructions on the Flutter website to install it.

  2. Make sure that the Flutter binary is added to your PATH environment variable. You can do this by running the following command:

export PATH="$PATH:$HOME/flutter/bin"
  1. Restart your terminal session or run the following command to reload your zsh shell configuration:
source ~/.zshrc
  1. Try running the flutter command again. If it still fails, you may need to run the following command to fix the issue:
hash -r

You can also try uninstalling and re-installing the Flutter SDK if the issue persists.

How to install Flutter SDK

To install the Flutter SDK on Windows, MacOS, and Linux, follow the instructions on the Flutter website:

  1. On Windows, download the Flutter SDK from the Flutter website and unzip it to a location on your computer.

  2. On MacOS and Linux, open a terminal window and run the following commands:

# Download the Flutter SDK
$ git clone https://github.com/flutter/flutter.git

# Navigate to the flutter directory
$ cd flutter

# Run the flutter doctor command to check for any dependencies that need to be installed
$ flutter doctor
  1. If the flutter doctor command reports any missing dependencies, follow the instructions on the Flutter website to install them.

  2. Once all dependencies are installed, you can run the flutter command to access the Flutter tools.

Note: The installation process may vary slightly depending on your operating system and version. Refer to the Flutter website for the latest instructions.

Useful links:

Flutter

Related articles

Ruslan Osipov
Written by author: Ruslan Osipov