Step 1: Install arm64 Homebrew
Open a Terminal and veryify you are not in x86 emulation mode:
arch
You should see arm64.
Now, we're going to follow homebrew's recommendation and install homebrew to /opt/homebrew. Below are the commands to create that folder, set the perms of that folder, then install homebrew and add it to your path.
cd /opt
sudo mkdir homebrew
sudo chown -R $(whoami) homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
If you don't use zsh as your shell then adjust that last command accordingly
Now either open a new terminal with your updated .zshrc or source it (source ~/.zshrc) so you can run the brew command from anywhere in your terminal.
Step 2: Install Node via Homebrew
This is the easy part... since our homebrew install is arm64 any bottles installed from it are also arm64. So to install the arm64 version of node just run:
brew install node
That's it, happy dev'ing on ARM!
Or from the RSS feed
Hopefully you found this post helpful, if you have any questions or comments you can reach me via electronic mail.