. Advertisement .
. Advertisement .
While running homebrew on macOS Big Sur, the following problem Warning: /opt/homebrew/bin is not in your PATH in macOS Big Sur appears. If you encounter the same issue, the below article will fill you with all possible solutions to this problem. So, let’s get started!
What Is The Warning: /opt/homebrew/bin is not in your PATH in macOS Big Sur Error?
When you looking for some blogs about M1 chip and thought you would need to install Rosetta 2 on the mac to install homebrew.
But, before you Rosetta 2, you tried installing the plain old
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". The went through, and you saw “Installation successful!”. However, the only problem is that you saw the following warning.
Here is what the error looks like.
Cloning into ‘/opt/homebrew/Library/Taps/homebrew/homebrew-core’... remote: Enumerating objects: 67, done. remote: Counting objects: 100% (67/67), done. remote: Compressing objects: 100% (47/47), done. remote: Total 877969 (delta 32), reused 39 (delta 20), pack-reused 877902 Receiving objects: 100% (877969/877969), 348.33 MiB, 11.95 MiB/s, done. Resolving deltas: 100% (594177/594177), done. Tapped 2 commands and 5416 formulae (5,724 files, 382.4MB). Already up-to-date. Warning: /opt/homebrew/bin is not in your PATH.
The simple solutions for the error
It is the location where the packages or homebrew are stored. Thus you must add the homebrew path to /.zshrc OR /.bashrc.
For the above reason, follow these steps to add PATH.
- Add the following to the end of your /.zshrc or /.bashrc file:
- Insert the following line at the end of the file:
With the second solution,
- Fix your ~/.bashrc.
- Then, if you wish to edit it, apply the following example.
- If you cannot find bashrc, use this command.
- Then paste as normal.
- Open the file, save and exit, and then restart bash.
Then you’re all set.
- Check to see if you’ve already installed the Xcode. In your application, type the following command: /usr/bin/xcodebuild -version
- It will display the example output shown below. Version 12C33 of Xcode 12.3
- Now launch Xcode. Choose your preferences. Choose the location tab. Pick your Xcode edition from the dropdown menu.
- Run the following command: /bin/bash -c $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
- If you have an M1 Chip Mac, perform the following command, close and reopen the terminal.
>> echo “export PATH=/opt/homebrew/bin:$PATH ~/.zshrc
Add these lines to the
if [[ "$(uname -m)" == "arm64" ]]; then
This will check whether your architecture is ARM (like MacOS M1) and add the path only if that’s the case.
Take your time and visit our blog post if you cannot solve the Warning: /opt/homebrew/bin is not in your PATH in macOS Big Sur error. We believe you will resolve the problem after you finish reading our solutions.
Please let us know by posting your solution below if it is not. Thank you, and we hope you found our post helpful!
Leave a comment