Learn how to fix problems installing Homebrew on a MacBook with an M1 chip.
After trying to install Homebrew on a new MacBook Pro 13″ 2020, the above error exception appears on the terminal. In this article, I will explain to you how to fix this issue and continue with the workflow as usual.
Install via Rosetta 2
How to fix the error Homebrew is not (yet) supported on ARM processors? The new Mac with the M1 chip uses the arm64 CPU architecture, the same one used by recent iOS devices (Intel-based Macs use an architecture called x86-64). This in itself means that apps developed to run on iOS and iPadOS will also run on macOS. However, this means that applications developed for Intel architecture will not run natively on new Apple hardware (which is exactly what happened with Homebrew).
That’s where the Rosetta 2 emulator comes in. It is an emulator built into macOS Big Sur that allows ARM Macs to run old Intel applications. The emulator basically translates the instructions written by the Intel processor into commands that Apple silicon can understand. As a developer, you don’t need to make any changes to your old apps, they will work. In this case, to install Homebrew with this compatibility, run the installation command with the following prefixes:
arch -x86_64
So the installation command for Homebrew is as follows:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Fix the error Homebrew is not (yet) supported on ARM processors: This command will run the default homebrew installer and set it in the directory. So whenever you need to do something with brew again, you just need to put it before:/usr/localarch -x86_64
arch -x86_64 brew <your instruction>
That’s it! For example, if you want to install a new package, the following command will solve the problem:
arch -x86_64 brew install <package>
Of course, this is annoying, however, this does not happen forever and in the future with good luck the project will provide support for the new Apple silicon.
Happy coding ❤️!