Navigate:
~$NVM0.1%

nvm: Node.js version manager for POSIX shells

nvm is a per-user, per-shell version manager for Node.js that allows switching between multiple installed Node versions from the command line. It works on any POSIX-compliant shell across Unix, macOS, and Windows WSL environments.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#122
26
DEVELOPER TOOLS
#22
7
30 DAY RANKING TREND
ovr#122
·Devel#22
STARS
90.8K
FORKS
9.7K
DOWNLOADS
14.8K
7D STARS
+49
7D FORKS
+5
See Repo:
Share:

Learn more about nvm

nvm is a version management tool for Node.js that operates as a set of shell functions loaded into POSIX-compliant shell environments rather than as a standalone executable. It works by dynamically modifying the shell's PATH environment variable to point to different Node.js installations stored in isolated directories within the user's home directory, enabling per-shell version switching without requiring system-level permissions. The tool supports automatic version detection through configuration files that specify which Node.js version a project requires, triggering the appropriate PATH manipulation when entering project directories. nvm maintains a local registry of available Node.js versions and downloads binary distributions on demand, storing each version in a separate subdirectory to prevent conflicts. This architecture allows multiple Node.js versions to coexist on a single system while maintaining complete isolation between installations, though the shell-function approach means it must be sourced into each shell session rather than being globally available as a system command.

nvm

1

POSIX-compliant implementation

Written as a bash script that works across any POSIX-compliant shell (sh, dash, ksh, zsh, bash) rather than being shell-specific, enabling consistent behavior across different Unix-like environments and shells.

2

Per-user installation model

Installs to the user's home directory (~/.nvm) without requiring system-wide permissions or administrative access, allowing multiple users on the same system to maintain independent Node version configurations.

3

.nvmrc file integration

Supports project-level version specification through .nvmrc files, with optional shell integration to automatically switch Node versions when entering directories, enabling version consistency across development teams.


// .nvmrc file in project root
// 16.9.1

// In your Node.js script, verify version matches
const { execSync } = require('child_process');
const fs = require('fs');

const requiredVersion = fs.readFileSync('.nvmrc', 'utf8').trim();
const currentVersion = process.version.slice(1);

if (!currentVersion.startsWith(requiredVersion)) {
  console.error(`Expected Node ${requiredVersion}, got ${currentVersion}`);
  process.exit(1);
}


vv0.40.3

Fixes node version detection in nvm_install_latest_npm command; no breaking changes or new requirements.

  • Update to resolve incorrect node version parsing when installing the latest npm via nvm_install_latest_npm.
  • No action required unless you encountered npm installation failures in prior versions.
vv0.40.2

Maintenance release fixing corepack reinstall issues, npm v11 compatibility, and LTS alias validation errors.

  • Avoid reinstalling corepack when using `reinstall-packages` to prevent conflicts with Node.js bundled versions.
  • Expect stricter LTS name validation; invalid or non-lowercase LTS names now trigger explicit errors in install and alias commands.
vv0.40.1

Bug-fix release improving `nvm install -b` error handling and fixing shell compatibility issues with `set -e` and aliased commands.

  • Update scripts if you rely on `nvm install -b`: it now fails cleanly when no binary is available instead of falling back to source.
  • Review any custom `--save` usage or `tput` aliases, as quoting and conflict fixes may change behavior in edge cases.

See how people are using nvm

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers