GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
2 months ago
- #developer-tools
- #nodejs
- #version-manager
- nvm is a version manager for Node.js, allowing users to quickly install and use different versions of Node via the command line.
- Installation can be done via curl or wget commands, which download and run the install script from the nvm repository.
- nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash) and supports Unix, macOS, and Windows WSL platforms.
- The installation script clones the nvm repository to ~/.nvm and attempts to update the shell profile file (~/.bashrc, ~/.bash_profile, ~/.zshrc, or ~/.profile).
- Users can customize the installation by setting environment variables like NVM_DIR, PROFILE, and NODE_VERSION.
- nvm supports installing specific versions of Node, setting aliases, and managing default versions for new shells.
- The tool provides commands like nvm ls-remote to list available versions and nvm use to switch between installed versions.
- nvm can automatically detect and use versions specified in .nvmrc files within project directories.
- For development environments, nvm can be integrated into Docker containers, with examples provided for Ubuntu-based images.
- Compatibility issues may arise on systems like Alpine Linux due to musl libc, requiring source compilation with the -s flag.
- Troubleshooting tips are provided for common issues, such as command not found errors, macOS-specific problems, and WSL-2 DNS resolution issues.
- nvm is maintained by @ljharb, with commercial support available for older versions through partners.
- The project is licensed under the MIT license, with copyright held by the OpenJS Foundation and nvm contributors.