How to Install Node.js 14 on Mac Silicon Series

Manoj ThapaManoj Thapa
2 min read

If you’re trying to install Node.js 14 using nvm on your macOS M-series computer and facing difficulties, you’re not alone. The reason is that Node.js 14 does not have an official ARM64 binary available, unlike Node.js 16 and later versions that support ARM64 natively. Here’s how you can work around this limitation by leveraging Rosetta 2.

Understanding the Problem

Node.js 14 was released before the ARM-based Apple Silicon (M1, M2, etc.) was introduced, and thus, no ARM64 binary is provided for this version.
https://nodejs.org/dist/v14.21.3/
If you need to use Node.js 14 specifically, you must run it under Rosetta 2—Apple’s translation layer that allows ARM Macs to run x86 (Intel) binaries.

Solution: Using Rosetta 2

To install and run Node.js 14 on your Mac M-series computer, follow these steps:

  1. Install Rosetta 2 (if not already installed). Run this command in Terminal:

     /usr/sbin/softwareupdate --install-rosetta
    
  2. Install Node.js 14 under Rosetta 2 by creating a shell session that runs in x86 mode and using nvm to install Node.js:

     arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh)"
    
  3. Switch to an x86-based shell by using the following command:

     arch -x86_64 zsh
    
  4. Install Node.js 14 using nvm in this x86-based shell:

     nvm install 14
    

Running Node.js 14 Commands

Once installed, make sure to always use arch -x86_64 before running commands related to Node.js 14 to ensure they run under Rosetta. For example:

arch -x86_64 node -v
arch -x86_64 npm start

Why Use Rosetta 2?

Rosetta 2 provides a seamless way to run x86 binaries on ARM-based Macs, enabling developers to work with older software that hasn’t been updated for ARM64. Although not as fast as native ARM binaries, it’s an effective solution until you can upgrade to a version that supports ARM natively.

Final Thoughts

While the future is moving toward ARM64, sometimes working with legacy versions like Node.js 14 is unavoidable. Thankfully, Rosetta 2 bridges this gap smoothly, allowing developers to continue their work without interruption.

Pro Tip: If you’re not bound to using Node.js 14, consider upgrading to Node.js 16 or newer for better performance and ARM64 support.

By following these steps, you’ll be able to install and run Node.js 14 on your Mac M-series computer without issues.

0
Subscribe to my newsletter

Read articles from Manoj Thapa directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manoj Thapa
Manoj Thapa