Hello guys how are you all ? Hope you all are fine. when I was installing homebrew in MacOS Big Sur (M1 Chip). Warning: /opt/homebrew/bin is not in your PATH. Getting a warning when installing homebrew on macOS Big Sur (M1 chip)
So Here is I am come with all possible solution to solve this error. So without wasting your time. Lets start this article.
What is Error ?
The only issue is that I saw the following waring.
homebrew Warning: /opt/homebrew/bin is not in your PATH.

Solutions
Warning : /opt/homebrew/bin is not in your PATH in macOS Big Sur.
Warning indicate that it is the directory where the binaries or homebrew are put, so you have to add homebrew path to ~/.zshrc OR ~/.bashrc
Solution 1
Waning is indicating that it is the directory where the binaries or homebrew are put, so you have to add homebrew PATH into ~/.zshrc OR ~/.bashrc. Follow below step to add PATH.
- Edit your ~/.zshrc or ~/.bashrc with at the end of file :
- Enter This Line At End of File :
export PATH=/opt/homebrew/bin:$PATH
- That’s it.
For more infos about the current status of Homebrew on Mac with a M1 chip : Apple Silicon support in Homebrew
Solution 2
To resolve, you can do :
- Edit your ~/.bashrc with at the end of file :
export PATH=/opt/homebrew/bin:$PATH
2. To edit
vi .bashrc
3. if bashrc not found
touch ~/.bashrc
4. and paste
export PATH=/opt/homebrew/bin:$PATH
5. in the file then save and quit the file and then reload bash or
source ~/.bashrc
and you’re good to go.
Solution 3
- 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
- Now Open Xcode Select preferences Select location tab Now in command Line Tool select your Xcode version from dropdown menu
- 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
Summery
So it’s all About this issue. Hope Getting a warning when installing homebrew on macOS Big Sur (M1 chip), Warning: /opt/homebrew/bin is not in your PATH. above all solution helped you a lot. Comment below Your thoughts and your queries. And Also Comment on your suggestion here.
Also Read
- How to make a blur Background Image effect in Flutter using BackdropFilter.
- SyntaxError: invalid syntax to repo init in the AOSP code in Python
thanks for this post.
I solved through your instruction : D!
Have a good one!