Skip to main content
To install Node.js using NVM (Node Version Manager) on Linux, follow these steps:

Step 1: Install NVM

  1. Open your terminal.
  2. Run the following command to download and install NVM:
    🔹 Replace v0.39.7 with the latest NVM version from the NVM GitHub.
  3. Reload your shell configuration to apply changes:
  4. Verify NVM installation:
    If NVM is installed correctly, you’ll see its version number.

Step 2: Install Node.js Using NVM

  1. List available Node.js versions:
  2. Install the latest stable Node.js version:
    OR, install a specific version (e.g., 20.14.0):
  3. Verify the installation:

Step 3: Set Default Node.js Version

If you have multiple Node.js versions, set a default version:

Step 4: Check Installed Node.js Versions

List all installed Node.js versions:

Step 5: Uninstall Node.js (If Needed)

To remove a specific Node.js version:

Bonus: Install Yarn (Optional)

If you need Yarn (a package manager alternative to npm), install it with:
Verify with: