Getting a warning when installing homebrew on MacOS Big Sur (M1 chip) [closed]
Solution 1:
I had the same issue today, on Mac OS Big Sur (with M1 chip).
The problem is indicated in the warning : Warning: /opt/homebrew/bin is not in your PATH.
It seems that it is the directory where the binaries of hombrew are put.
To resolve, you can do :
- Edit your ~/.zshrc or ~/.bashrc with at the end of file :
export PATH=/opt/homebrew/bin:$PATH
After this, tap source ~/.zshrc
in your terminal or restart it.
For more infos about the current status of Homebrew on Mac with a M1 chip : Apple Silicon support in Homebrew
Edit :
As mentioned by @kangkyu in this comment, Homebrew is changing to version 3.0.0 which supports officially Apple Silicon. If you have a prior version just brew update
.
Solution 2:
I have this warning too, but if you look at the "Next steps" and run those two lines, then you would be fine.
Solution 3:
I also have the same issue today, on Mac OS Big Sur (with M1 chip). After installing from Homebrew homepage.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To resolve, you can do :
Edit your ~/.bashrc with at the end of file :
export PATH=/opt/homebrew/bin:$PATH
To edit
vi .bashrc
if bashrc not found
touch ~/.bashrc
and paste
export PATH=/opt/homebrew/bin:$PATH
in the file then save and quit the file and then reload bash or
source ~/.bashrc
and you're good to go.
Solution 4:
How To Set Up Your Mac for Homebrew
Step 1
Check you have already Install the Xcode. Run the below command in your terminal
/usr/bin/xcodebuild -version
It will print the below sample output Xcode 12.3 Build version 12C33
Step 2
Now Open Xcode Select preferences Select location tab Now in command Line Tool select your Xcode version from dropdown menu
Step 3
In terminal run below command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Note : if you have M1 Chip Mac run the below command, close terminal and open the terminal again
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
Solution 5:
This is an issue you experience when installing homebrew on an ARM architecture (like the MacOS with M1 chip).
You can add these lines to your .bashrc
(or .zshrc
):
if [[ "$(uname -m)" == "arm64" ]]; then
export PATH="/opt/homebrew/bin:${PATH}"
fi
This will check whether your architecture is ARM (like MacOS M1) and add the path only if that's the case. It is especially useful if you are sharing the same .bashrc
(or .zshrc
) configuration across multiple computers with different architectures.
I suppose that Homebrew will implement this automatically soon enough: they're doing a lot of good work on fixing issues with ARM architecture right now.