How to install and use NVM
Blog post from LogRocket
Node Version Manager (NVM) is a command-line tool that streamlines the management of multiple Node.js versions, crucial for projects requiring different versions to avoid conflicts. It provides isolated environments for each project, allowing easy installation, switching, and management of Node.js versions. The installation process for NVM varies across systems, with Unix-based systems using curl, while Windows relies on either the Windows Subsystem for Linux or a project called NVM for Windows. With NVM, users can list available versions, install specific or latest Node.js versions, and set defaults for new terminal sessions. Advanced features include project-specific version management via a .nvmrc file, specifying custom download sources, and running commands in a specific Node.js context. Troubleshooting common issues involves ensuring NVM is in the system's PATH and resolving permission problems, while best practices emphasize per-user installations, avoiding shared environments, and keeping NVM updated.