MacBook M1 homebrew install error

Error

Cannot install in Homebrew under Rosetta 2 in ARM default prefix (/opt/homebrew)!

Fix

- Make sure Rosetta2 installed. If not, install with below command (make sure the terminal is not checked on "Open using Rosetta" in app info)
/usr/sbin/softwareupdate --install-rosetta --agree-to-license

- Then remove '/opt/homebrew' out of your PATH in (.zprofile or .bash_profile). 
- Right-click on terminal -> Get Info -> Check to "Open using Rosetta" to enable Rosetta mode as default 
- Then close all terminal instance and reopen it
- Install homebrew again
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Then, you can install homebrew package normally with brew command
brew install node

Leave a Reply

Your email address will not be published.Required fields are marked *