9

I have an M1 Mac Mini. Every time I want to use brew in a new terminal, it tells me :

zsh: command not found: brew

So I always do this to solve it :

export PATH=$PATH:/opt/homebrew/bin

But then the next time I open a terminal, this has been forgotten. Is there a way to make it stick? I wonder why the homebrew installation doesn't do this by default? (It does warn me that it's not added to the path during installation).

Thanks!

SwammiM
  • 463
  • 6
  • 15

1 Answers1

8

Create/open the ~/.zshrc file and add this line to it: export PATH=$PATH:/opt/homebrew/bin

Navin
  • 3,681
  • 3
  • 28
  • 52
  • 2
    That did the trick, thanks! I actually tried this before, but in hindsight I think my mistake then was that I was root when I tried it, so it didn't save in the correct spot. – SwammiM Mar 02 '21 at 23:06