Hi everyone, hope you're doing well and staying safe 😊 I am running Mac OS Sequoia on an m2 MacBook Pro.
For the past while now, I have tried to use Homebrew in Terminal to install programs, but sometimes I get an error saying "zsh: command not found" Why do people think this could be? My initial thoughts are that the mane homebrew path/paths are not configured correctly, would anyone know how I can check this and what the correct configurations would be?
Failing this, does anyone have any other thoughts about what could be going wrong here, and how I can resolve this problem. Thank you very much for your help in advance, everyone. 😊
By trey, 3 November, 2025
Forum
macOS and Mac Apps
Comments
This may help you
My advice would be to uninstall, and reinstall Homebrew by following the instructions in the following article:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-homebrew-on-macos
HTH.
Also
It tells you during the install how to set the paths. In terminal do command A and then command C, and paste the lot into text edit. You'll be able to grab the syntax from there and pop it back in.
Shell configuration
You should have the following in your ~/.zprofile file:
eval "$(/opt/homebrew/bin/brew shellenv)"
zSh or BASh
Another alternative might be to switch your shell from zSH to bash, for compatibility sake. That could possibly be while you're getting the error when trying to install certain apps through Homebrew.
re shell configuration?
Hi,
Thanks for telling me about the shell configuration thing. How do I check if this is in the file you mentioned? Also, how do I go about adding it to the file if it isn't there?
Thank you very much.
trey
Follow these steps:
1. Go to your home directory by pressing command, shift, H.
2. Make sure hidden files are visible, by pressing command, shift,dot (That last key is the period key).
3. Look for the ".zprofile" file. If you do not have one, you can simply create it yourself. If you need to create it, simply open up terminal, and type the following:
Touch ~/.zprofile
4. Open that file, and copy/paste the following code from Jason White's post.
eval "$(/opt/homebrew/bin/brew shellenv)"
5. Save an exit the file. Make sure you leave it in your home directory.
Now, open up a fresh terminal, window running zSH, and things, should, work as expected.
Edited for typos