π Installing NVM on Windows (WSL - Ubuntu)
Follow these steps to install Node Version Manager (NVM) inside your WSL Ubuntu environment.
β Prerequisites
- WSL2 with Ubuntu installed
- Internet connection
π Installation Steps
# 1. Download and run the NVM install script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# 2. Load NVM into the current shell session
source ~/.bashrc
# 3. Verify NVM is installed
nvm --version
# 4. Install the latest LTS version of Node.js
nvm install --lts
# 5. Set it as the default version
nvm alias default lts/*
π¦ Verify Installation
# Check Node.js version
node -v
# Check npm version
npm -v
You're now ready to manage Node.js versions in your WSL environment using NVM!
π Common NVM Commands
# List all available Node.js versions
nvm ls-remote
# Install a specific version
nvm install 16.14.0
# Switch to a specific version
nvm use 16.14.0
# List installed versions
nvm ls
# Set default Node.js version
nvm alias default 16.14.0
Top comments (0)