If you’re a web developer like me, you have been very intrigued by the reports of incredible performance and efficiency of the new M1 chip in Apple’s latest Mac lineup. You may also be a bit skeptical about whether you can use an M1 Mac to perform all of your tasks as a developer. So far my journey has had a few bumps, but I’ve been able to successfully install and run all of the tools and workflows that I need.
One of the essential tools I use as a web developer is NodeJS and npm. I searched for a way to install Node natively on Apple Silicon.
Here is what I learned:
Currently, you can install Node natively on ARM (M1) by installing the latest version 15.6.0 of Node. The older versions will still work, but they will need Rosetta 2 to run properly. Here’s how to do it:
- Install nvm (Node Version Manager)
# run this command in Terminalcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
2. Install NodeJS version 15
nvm install v15
You may be prompted to install command line developer tools if you haven’t already. Install them and you may need to run the command again. Nvm will build Node from source, which will take a while (around 10 minutes for me).
3. Verify that NodeJS and npm were installed
# check for node
node -v# check for npm