DEV Community

Cover image for zsh: command not found: brew

zsh: command not found: brew

Dorcas Adjeley Laryea on March 10, 2024

My first time setting up git on my Macbook was a few years ago. My second time was this week, and I faced the same error I faced the first time, ex...
Collapse
 
moopet profile image
Ben Sinclair

The fact that you saw git version 2.39.3 (Apple Git-146) in response to your command tells you that git was already installed. You didn't need to install another version with homebrew.

The issue where brew wasn't found in your path was likely because the installer added that line to your shell's (in this case zsh) startup files, but doesn't run them for you. If you exit the shell and start a new one then it would run.

In short: restart your terminal after installing homebrew, and don't install git with homebrew unless you have a specific requirement to do so.

Collapse
 
naalaryea profile image
Dorcas Adjeley Laryea

Yes, that is true, git was already installed it turned out, except that restarting my terminal did not rectify the issue, so I went through the whole process of installing homebrew myself and then set the path.

I will try this suggestion on an old macbook and hopefully it's easier there. Thank you so much for this insight!!