Install Node on M1 Mac

Sventies picture Sventies · Dec 17, 2020 · Viewed 52.7k times · Source

Kind of a noob here on questions about binaries, processors and how that all works together:

I have a new Mac with an M1 chip, and want to install Node. I'm used to do this with Homebrew. Now, if I install Homebrew, I'm strongly recommended to use Rosetta, so I did. Next step: installing Node. So instead of brew install node I do arch -x86_64 brew install node.

This works fine, only I'm wondering, am I now using node in a sub-optimal way? Is Node also using Rosetta, instead of directly running on the M1 chip?

Answer

Mark picture Mark · Dec 25, 2020

I just got my M1 Mac mini. I did add an alias since I use oh-my-zsh to my ~/.zshrc for alias brew='arch -x86_64 brew so I don't have to keep typing all that. I brew install nvm then nvm ls-remote and installed v15.5.0. It gets built DV8_TARGET_ARCH_ARM64.

Hope that helps. I also pulled the insiders VSCode for ARM64. Loads in a second.

> node -p "process.arch" arm64

Don't forget you need xcode-select --install command line tools (~450MB).