Reputation: 151
Once I install homebrew on my terminal it works. But when I close the terminal and reopen to use brew, it cannot find the command.
On reopening the terminal it says:
/Users/abc/.zshrc:export:2: not valid in this context: Support/JetBrains/Toolbox/scriptseval:/opt/homebrew/bin:/opt/homebrew/bin
This is what my .zprofile looks like after installing homebrew using the official docs:
# Added by Toolbox App
export PATH="$PATH:/Users/anshgupta/Library/Application Support/JetBrains/Toolbox/scripts"
eval "$(/opt/homebrew/bin/brew shellenv)"
Please explain why does it not recognise that I have installed it and how can I fix this
Upvotes: 1
Views: 5559
Reputation: 778
OnTerminal,
~ % git clone https://github.com/Homebrew/brew homebrew
~ % eval "$(homebrew/bin/brew shellenv)"
~ % brew update --force --quiet
~ brew update
Already up-to-date.
Here brew installation documentation link - https://docs.brew.sh/Installation
Upvotes: 3
Reputation: 116
Try putting the line eval "$(/opt/homebrew/bin/brew shellenv)"
to the top of the file, save it and restart your terminal.
Upvotes: 3