W3Schools Learner's Blog

W3Schools Programming knowledge summary website

div

5/30/2024

zsh: command not found: flutter - resove

 The “zsh: command not found: flutter” error typically occurs when the flutter command-line tool is not found in your system's PATH. To fix this issue, you need to ensure that the Flutter SDK is properly installed and added to your system's PATH.

Follow these steps to resolve the “zsh: command not found: flutter” error:

Step 1: Check Flutter Installation Ensure that you have installed Flutter correctly on your Mac. If you haven’t installed Flutter yet, you can download it from the official Flutter website: https://flutter.dev/docs/get-started/install

After installation, extract the Flutter archive to any location on your Mac. For example, you can extract it to your home directory or a custom directory like “/opt/flutter”.

Step 2: Add Flutter to PATH Open your terminal and edit your shell profile configuration file. Assuming you are using the Zsh shell, you can use the following command to open the .zshrc file:

open -e ~/.zshrc

If you are using a different shell, such as Bash, you can open the .bash_profile file instead:

open -e ~/.bash_profile

Step 3: Add Flutter to PATH In the opened file, add the following line to the end of the file:

export PATH=”$PATH:/path/to/flutter/bin”

Save the file and close the text editor.

Step 4: Update Shell Configuration To apply the changes, reload your shell configuration. If you are using Zsh, run:

source ~/.zshrc

source ~/.bash_profile

Step 5: Verify Flutter Installation Finally, verify that Flutter is correctly set up by running:

flutter doctor

Thanks !!!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.