zsh: command not found: flutter usually indicates that the flutter path is not mentioned in .zshrc file. This issue commonly happens when you upgrade macOS and try to run any flutter command from the terminal. We also face this issue when you install android studio and set flutter SDK path to it first time and try to run any flutter command from terminal.
We can solve this issue by following two types of approaches.
1. Adding flutter SDK path from terminal.
2. Manually adding flutter SDK path to .zshrc file.
– Open a terminal and hit the following command.
vim $HOME/.zshrc
– Now it will open a file in terminal and show its content.
– Press the i key to enable insert mode, then you can add a flutter sdk path.
Format: export PATH=”$PATH:/YOUR_FLUTTER_DIR/flutter/bin”
Example: export PATH=”$PATH:/Users/Rohan/Flutter/flutter-3.10.0/flutter/bin”
– Press “Esc” and write :wq! Then hit enter to save this file.
– Now Reopen the terminal and run flutter –version command.
– Now you are able to run any flutter commands.
– Open the finder and navigate to admin directory.
– Press cmd + shift + . For unhide files.
– Open .zshrc file and add flutter SDK path.
Format: export PATH=”$PATH:/YOUR_FLUTTER_DIR/flutter/bin”
Example: export PATH=”$PATH:/Users/Rohan/Flutter/flutter-3.10.0/flutter/bin”
– Now open the terminal and run flutter –version command.
– Now you are able to run any flutter commands.