> ## Documentation Index
> Fetch the complete documentation index at: https://programming-for-career.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Node.js Using NVM

> Learn how to install Node.js using NVM (Node Version Manager) on Linux in a few simple steps.

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**:

   ```sh theme={null}
   curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
   ```

   > 🔹 Replace `v0.39.7` with the latest NVM version from the [NVM GitHub](https://github.com/nvm-sh/nvm).

3. **Reload your shell configuration** to apply changes:

   ```sh theme={null}
   source ~/.bashrc  # For Bash users
   source ~/.zshrc   # For Zsh users
   ```

4. **Verify NVM installation**:
   ```sh theme={null}
   nvm --version
   ```
   If NVM is installed correctly, you’ll see its version number.

### **Step 2: Install Node.js Using NVM**

1. **List available Node.js versions:**
   ```sh theme={null}
   nvm ls-remote
   ```

2. **Install the latest stable Node.js version:**

   ```sh theme={null}
   nvm install --lts
   ```

   OR, install a specific version (e.g., **20.14.0**):

   ```sh theme={null}
   nvm install 20.14.0
   ```

3. **Verify the installation:**
   ```sh theme={null}
   node -v
   npm -v
   ```

### **Step 3: Set Default Node.js Version**

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

```sh theme={null}
nvm use 20.14.0  # Use specific version
nvm alias default 20.14.0  # Set it as default
```

### **Step 4: Check Installed Node.js Versions**

List all installed Node.js versions:

```sh theme={null}
nvm ls
```

### **Step 5: Uninstall Node.js (If Needed)**

To remove a specific Node.js version:

```sh theme={null}
nvm uninstall 20.14.0
```

### **Bonus: Install Yarn (Optional)**

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

```sh theme={null}
npm install --global yarn
```

Verify with:

```sh theme={null}
yarn -v
```
