Search code examples
macosinstallationterminalhomebrewmacos-monterey

Brew stops working after terminal session is closed


I have installed Brew in MACOS Monterey with the following commands. mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

eval "$(homebrew/bin/brew shellenv)"

brew update --force --quiet

chmod -R go-w "$(brew --prefix)/share/zsh"

I have tested it after the install, and it works, however closing the terminal session and opening it again causes terminal to say that the command brew is not found after running it. I can still see the homebrew directory, so Im guessing its in the wrong place for terminal to run it.


Solution

  • Ok I was able to fix the issue by adding the PATH to the .bash_profile file.