Flutter path is not saving permanently on z shell mac os catalina every time after closing the terminal

1,906

Solution 1

You mention that you got a MacBook that you then updated to Catalina after the fact. The default terminal shell for Catalina is zsh, but before Catalina it was bash, and any Mac that was updated to Catalina from an older version still has bash as the default. If this is the case for you, you need to do one of the following:

  • Change the default shell for your terminal to zsh with the command chsh -s /bin/zsh (more info)
  • Add the path export script to a file named .bash_profile instead (same location where you created .zshrc).

Solution 2

In my case adding the following to Users/me/.zshrc solved the problem:

export PATH="$PATH:/Users/me/development/flutter/bin"
Share:
1,906
Funny Boss
Author by

Funny Boss

Updated on December 15, 2022

Comments

  • Funny Boss
    Funny Boss over 1 year

    i am using mac os catalina and i created .zshrc file and added the following line for flutter

    export PATH="$PATH:/Users/me/development/flutter/bin"
    

    this is the content of the .zshrc file:

    enter image description here

    but when i closed the terminal and reopen a new terminal, flutter command is not working. so every-time again and again, i need to type source $HOME/. to make it working.

    is there any permanent solution so that the path will not be removed.