This one is tricky. But if you need to build an application for intel chips while having an Apple silicon one... You might need to install dependencies "incompatibles" with your current chip.
Requirements
Make sure you have rosetta installed on your system:
$ softwareupdate --install-rosetta --agree-to-licenseRosetta is a tool provided by Apple that runs x86 binaries.
Homebrew installation
You can open a terminal to simulate the architecture x86 by using the following command:
$ arch -x86_64 zshThen, install homebrew (inside this shell!)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"ℹ️ Notice that a standard arm64 installation of homebrew installs homebrew in the directory /opt/homebrew, but the x86_64 version will be installed in /usr/local/Homebrew.
Create an alias
If you start a shell with rosetta (arch -x86_64 zsh) and type which brew , you will probably see that the version of brew used here is not the right one. You can of course call the right one, directly with:
$ /usr/local/Homebrew/bin/brew --helpA simple solution is to write an alias:
# Add the alias in your .zshrc
echo "alias x86_brew='arch -x86_64 /usr/local/bin/brew'" >> ~/.zshrc
# Reload your configuration
source ~/.zshrc
# Validate it's working fine
x86_brew --help