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.

Current Node versionnode --version
Search available and installed versionsbrew search node
Install latest versionbrew install node
Install specific versionbrew install node@8
Unlink latest Node versionbrew unlink node
Unlink older Node versionbrew unlink node@8
Link older versionbrew link node@8 --force --overwrite
Link latest versionbrew link node


Discuss on TwitterEdit on GitHub