NVM (Node Version Manager) is a CLI tool to manage multiple Node.js versions, perfect for switching between projects or testing on different versions.
To install NVM on macOS/Linux, use curl or wget command. On Windows, it is recommended to use NVM-Windows.
Some useful NVM commands include: installing a specific Node.js version, listing installed versions, switching between versions, setting a default version, updating to the latest version, showing the currently active version, running a file or executing a command using a specific version, and uninstalling a version.
For switching Node versions within a project, you can use a .nvmrc file in the project directory or tools like avn for automatic version switching.