How to Manage Multiple Node Versions in MacOS Ventura. (2023 Guide)
Introduction
If you work on multiple Node.js projects, you’ve probably run into this one time or another. You have the latest and greatest version of Node.js installed, and the project you’re about to work on requires an older version. In those situations, the Node Version Manager (nvm) is a great tool to use, allowing you to install multiple versions of Node.js and switch between them as you see fit.
In this tutorial, you will install nvm
and learn to install, remove, and switch between different versions of Node.js.
Prerequisites
To complete this tutorial, you will need to have the latest node version installed on your machine, for that you have a few options.
1. Through macOS Installer directly from the nodejs.org website.
2. Through Homebrew as follows.
brew install node
3. Through a CURL as follows.
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"