How to switch Node version on macOS

The easiest way to install and switch between different versions of Node.js is with Homebrew package manager.

Search and install versions

Currently active versionnode --version
Search available and installed versionsbrew search node
Install latest versionbrew install node
Install older versionbrew install node@12

Change version

Unlink latest versionbrew unlink node
Unlink older versionbrew unlink node@12
Link latest versionbrew link node && brew postinstall node
Link older versionbrew link --overwrite node@12


Edit on GitHub · Discuss on Twitter