The easiest way to install and switch between different versions of Node.js is with Homebrew package manager.
Search and install versions
Action | Command |
---|
Currently active version | node --version |
Search available and installed versions | brew search node |
Install latest version | brew install node |
Install older version | brew install node@16 |
Change version
Action | Command |
---|
Unlink latest version | brew unlink node |
Unlink older version | brew unlink node@16 |
Link latest version | brew link node && brew postinstall node |
Link older version | brew link --overwrite node@16 |
Alternatives