. Advertisement .
..3..
. Advertisement .
..4..
Good day, everyone! I’m facing up with: ”zsh command not found brew” error for some days, but I have not found the answer yet. Here is the detail program which I run:
Last login: Sun Jun 6 12:42:43 on ttys000
[code2care@mac ∼ % brew
zsh: command not found: brew
code2care@mac ∼ % brew
Then it give me a warning message:
zsh: command not found: brew error
I read lots of documents, but I have not found the best solution to fix this error. Please give me some advice to solve it. Thanks!
The cause:
After I examined your progarm for a while, I found that there were 2 problem:
1, After you installed brew in macOS it was saved at the location – /opt/homebrew.
2, You did not set the path for brew installation.
Therefore, your error happend.
Solution:
To solve this error, first the brew command that you need have to be runned to the location of cd, then go into the bin folder and run the brew commands again.
Another solution is adding the path of brew installation in the .zshrc file by these steps:
1, Use the command:
nano ~/.zshrc
to open the.zshrc file
.2, Add: export
PATH="$PATH:/opt/homebrew/bin/"
to the file.3, Use Enter press Control + X to save the file.
4, Use command:
source ~/.zshrc
to apply changes.Now the brew command can be runned from anywhere.