Skip to content

Instantly share code, notes, and snippets.

@Ksound22
Last active October 20, 2022 10:43
Show Gist options
  • Save Ksound22/779e4336b2cb020cf88c2eaba1712e7f to your computer and use it in GitHub Desktop.
Save Ksound22/779e4336b2cb020cf88c2eaba1712e7f to your computer and use it in GitHub Desktop.
A step by step guide on how to install NVM and Node JS on WSL (Windows Subsystem for Linux)

How to Install NVM on WSL (Windows Subsystem for Linux)

  • Make sure your Linux distro is up to date by running sudo apt update && sudo apt upgrade.
  • Install cURL by running sudo apt-get install curl
  • Install NVM by running curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
  • Verify NVM installation by running command -v nvm
  • Check the available versions of Node JS by running nvm ls available
  • Install the latest release of Node JS by running nvm install node
  • Install the long-term support version by running nvm install --lts
  • Install a specific version by running nvm install <version number>. For example, nvm install 14.20.0
  • Verify the installation by running node --version or node -v
  • Check the versions of Node installed locally by running nvm ls
  • To use a specific version of Node JS, run nvm use <version>. For example nvm use lts or nvm use 14.20.0.

Other NVM Commands

  • nvm off — turns off version management for Node JS
  • nvm on — turns on version management for Node JS
  • nvm uninstall <version> — uninstalls a specific version of Node JS
  • nvm arch — shows whether NOde JS is running in a 32-bit or 64-bit mode

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment