How to Install Node JS 22 on macOS High Sierra

MacOS is an operating system that often becomes OS platform of choice for developers. With a vast ecosystem built around Apple products and services, developers may find it so convenient to use macOS for developing software. Besides convenience felt through the rich user experience, high usability, and intuitive UI, macOS has been known as a stable OS platform due to tight integration between the hardware and software. If you use macOS running on MacBook to develop software, you can experience first-hand how stable the system is. System freeze due to faulty driver or OS issue is quite rare. The machine just works and it works fine for years.

But here is actually the actual issue. After few years using the machine, you realize that Apple has officially dropped the support for the macOS version running on your MacBook and at the same time you can not upgrade to the latest macOS version because the hardware powering the MacBook is not supported anymore in the latest or newer macOS version. As Apple drops the support for the OS, software vendors also drop the support for their software products. Now, you’re left with software that still works fine but you cannot upgrade to the latest or near latest version of the software through its official distribution channel. This is since there is no newer version in the software release that supports the version of macOS you currently use.

A concrete example: when this article was written in February 2025, the latest version of NodeJS was NodeJS 23 and the highest LTS version was NodeJS 22. On the OS side, the latest version of macOS as of February 2025 was macOS 15 Sequoia (Darwin 24) released in September 2024. If your MacBook runs macOS 10.13 High Sierra (Darwin 17) with the final OS update release in November 2020, is it still possible to install and run NodeJS 22 on macOS High Sierra?

The answer: It is not possible to install NodeJS 22 binary on macOS High Sierra through the official Node JS download page or other software distribution channels for macOS like brewnvmn, or macports. However, you can still install and run NodeJS 22 on macOS High Sierra through unofficial method(s), which will be covered in this article.

Before we proceed with the installation method, let’s take a look at various versions of macOS and whether they are still officially supported by Apple in February 2025.

OS VersionRelease NameDarwin VersionApple clang Version(s)Apple Support (Feb 2025)
macOS 10.13High Sierra1710NO
macOS 10.14Mojave1810NO
macOS 10.15Catalina1912YES
macOS 11Big Sur2012, 13YES
macOS 12Monterey2114YES
macOS 13Ventura2214YES
macOS 14Sonoma2315YES
macOS 15Sequoia2416YES

As can be seen in the table, in February 2025, macOS 10.13 High Sierra and macOS 10.14 Mojave are already out of official support by Apple. If you’re still running macOS High Sierra or macOS Mojave and cannot upgrade to newer macOS version due to hardware constraint, upgrading software or libraries installed on your machine can be a tricky issue. This has also been discussed in a previous article where Node JS binary installation did not always work on macOS High Sierra even though the binary was downloaded from common software distribution channel for macOS.

Specific to Node JS, the documentation on the list of supported platforms for Node JS 18 specifies the lowest supported macOS version that can run Node JS 18 is macOS 10.15 Catalina. This means that machines running older macOS versions such as macOS 10.13 High Sierra or macOS 10.14 Mojave can only download, install, and run pre-built Node JS binaries up until Node JS 17 from Node JS binary distribution channels for macOS. In February 2025, the latest version of Node JS 17 was Node JS 17.9.1 that was released in June 2022.

It is important to note that official support for Node JS on a certain macOS version means that you can download, run, and install pre-built Node JS binary. If a macOS version is not supported, for example macOS 10.13 High Sierra, it simply means that you cannot get a pre-built binary from the distribution channel to be downloaded, installed, and run on your machine. However, it doesn’t mean you cannot run Node JS 22 on macOS High Sierra. As long as you have the Node JS 22 binary and its dependencies properly installed on your macOS High Sierra machine, you can still run Node JS 22,

So, what are the unofficial methods to install Node JS 22 on older version of macOS especially macOS High Sierra?

  1. Install Node JS 22 binary that has been custom-built for macOS High Sierra
  2. Install Node JS 22 from source. This method can be applied to various old macOS versions that include macOS High Sierra, macOS Mojave, or macOS Catalina.

The Easy Route: Installing Node JS 22 binary for MacOS High Sierra

This route was tested with macOS 10.13 High Sierra. If your machine runs macOS 10.14 Mojave, the steps explained herein may not work.

The steps below will install pre-built Node JS 22.2 on your machine. For higher version of Node JS (Node JS >= 22.3, Node JS 23), you can only go with the advanced route.

Installation steps:

1. Check if you have brew installed.

$ brew -v
Homebrew 4.4.20-180-g673f190-dirty
Homebrew/homebrew-core (git revision 2cf9064aca6; last commit 2025-02-14)

If you see the message -bash: brew: command not found, it means that brew has not been installed on your machine. Install brew before proceeding to the next step.

2. Check currently installed Node JS and its location.

$ node -v
v17.9.1

$ which node
/usr/local/bin/node

From the console output, Node JS 17.9.1 is currently running. This is the highest version of Node JS officially supported for macOS High Sierra. We will upgrade Node JS 17 to Node JS 22.

3. Download pre-built Node JS 22.2 to your machine.

Download URL: https://github.com/konnano/Using-HomeBrew-on-MacOS10.13-High-Sierra-/blob/main/node–22.2.0.high_sierra.bottle.tar.gz

4. Install Node JS binary (packaged as bottle file for brew) into your system.

$ brew install -f /PATH/TO/node--22.2.0.high_sierra.bottle.tar.gz

Replace /PATH/TO with the directory location where you downloaded the file.

During the installation, observe the output of the terminal. You may see something like this.

Warning: node 23.7.0 is available and more recent than version 22.2.0.
==> Pouring node--22.2.0.high_sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite node --dry-run

Possible conflicting files are:
/usr/local/bin/node
/usr/local/include/node/common.gypi
/usr/local/include/node/config.gypi
/usr/local/include/node/cppgc/common.h
/usr/local/include/node/js_native_api.h
...
/usr/local/include/node/v8.h
/usr/local/include/node/v8config.h
/usr/local/share/doc/node/gdbinit
/usr/local/share/doc/node/lldb_commands.py
/usr/local/share/man/man1/node.1
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall node
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
?  /usr/local/Cellar/node/22.2.0: 2,068 files, 78.4MB
==> Running `brew cleanup node`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/node/12.12.0... (4,595 files, 53.6MB)
Warning: The following dependents of upgraded formulae are outdated but will not
be upgraded because they are not bottled:
  yarn

As you can see in the output, the Node JS 22.2 binary has been installed but it has not been linked properly due to version conflict. This is normal since the machine was already installed with Node JS 17.9.1. We will resolve the issue by performing manual linking.

5. Back up previously installed Node JS and npm.

$ sudo chown -R `whoami`:admin /usr/local/bin
$ sudo chown -R `whoami`:admin /usr/local/share
$ sudo chown -R `whoami`:admin /usr/local/lib/dtrace
$ sudo chown -R `whoami`:admin /usr/local/include/node
$ sudo chown -R `whoami`:admin /usr/local/lib/node_modules
$ sudo chown -R `whoami`:admin /usr/local/lib/node_modules/npm

$ mv -f /usr/local/bin/node /usr/local/bin/node@17
$ mv -f /usr/local/bin/npm /usr/local/bin/npm.old

6. Run brew postinstall.

$ brew postinstall --debug node
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading node
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/node
==> Postinstalling node

7. Run brew link command for manually linking Node JS binary and libraries.

$ brew link --overwrite node
Linking /usr/local/Cellar/node/22.2.0... 112 symlinks created.

8. Check and verify that Node JS 22 has been installed on your machine.

$ node --version
v22.2.0

$ npm --version
10.7.0

Troublehooting:

Your installation may not run smoothly. One common error pattern that you may see is missing dependency. Node JS 22.2 needs the following dependencies to be installed on your machine:

  • pkg-config
  • python 3.12
  • brotli
  • c-ares
  • icu4c
  • libnghttp2
  • libuv
  • openssl 3

If you see an error related to a dependency, let’s use icu4c as an example, you can simply install the missing dependency as follows:

$ brew install icu4c@74
$ brew link icu4c@74

For other non-dependency error, it is recommended that you go the advanced route by installing Node JS 22 from source.

The Advanced Route: Installing Node JS from source to run on older macOS

Installing Node JS from source takes more time and patience, but it is usually a more guaranteed way to have the latest Node JS version running on your machine. In the previous section, it’s already explained that the highest Node JS 22 version that could be installed with downloaded pre-built binary was Node JS 22.2. Furthermore, your machine may run different macOS version such that installing the pre-built binary would not work and you’re left with the only option to install from source.

The key info that you need to obtain before going the advanced route is to know Apple clang version that runs on your machine. Run this command to get the info

$ clang --version

For macOS High Sierra with XCode installed, you may see output like the one below.

$ clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Pay attention to the line that contains Apple LLVM version. For Apple LLVM version 10 (clang 10), the highest Node JS version that can be compiled with Apple LLVM is Node JS 17. Meanwhile, the minimum LLVM version required by Node JS 22 is Apple LLVM version 12 (clang 12). This means that to install Node JS from source, we need to upgrade the compiler (Apple LLVM or clang) and build node JS with the version of compiler that is compatible with Node JS 22.

Leave a Reply

Your email address will not be published. Required fields are marked *