close

Getting a warning when installing homebrew on macOS Big Sur (M1 chip)

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.

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

Question : Getting a warning when installing homebrew on macOS Big Sur (M1 Chip).

Answer : 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.

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.

  1. Edit your ~/.zshrc or ~/.bashrc with at the end of file :
  2. Enter This Line At End of File :
export PATH=/opt/homebrew/bin:$PATH
  1. 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 :

  1. 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

  1. Check you have already Install the Xcode. Run the below command in your terminal
  2. /usr/bin/xcodebuild -version
  3. It will print the below sample output Xcode 12.3 Build version 12C33
  4. Now Open Xcode Select preferences Select location tab Now in command Line Tool select your Xcode version from dropdown menu
  5. In terminal run below command
  6. /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
  7. Note : if you have M1 Chip Mac run the below command, close terminal and open the terminal again
  8. 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) above all solution helped you a lot. Comment below Your thoughts and your queries. And Also Comment on your suggestion here.

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment