Search code examples
macospathzshmacos-catalina

zsh: command not found -- no longer have access to basic utilities and all installed softwares or packages from the terminal


Looks like I have managed to scramble my path variable when installing flutter, and now running yarn, shows zsh: command not found: yarn

This was the command I ran that I started experiencing the zsh command not found: echo 'export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin >> ~/.zshrc"

I ran the code solution suggested by @devnull https://stackoverflow.com/a/18428774/1766068

PATH=/bin:/usr/bin:/usr/local/bin:${PATH} export PATH it would work when I open a new tab, but if I should restart the terminal it no longer works.


Solution

  • Open your ~/.zshrc file in a text editor and remove the last line. Then logout and login again.