Skip to content

Instantly share code, notes, and snippets.

@rocktimsaikia
Last active August 15, 2020 19:57
Show Gist options
  • Save rocktimsaikia/70a309cf123e061db1782db32ea4a26a to your computer and use it in GitHub Desktop.
Save rocktimsaikia/70a309cf123e061db1782db32ea4a26a to your computer and use it in GitHub Desktop.
Steps to install windows subsystem for linux ⚡

Installing nodejs in Windows Subsystem for Linux (WSL) ⚡

Assuming that you already have WSL installed in your windows.

Steps

  1. update Ubutu to it's latest version. Don't if you already have.

sudo is equivalent to running as administrator

sudo apt-get update
sudo apt-get upgrade
  1. install nvm which is node version manager.

This will install v0.35.0, check the nvm repo if there are newer versions.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
  1. Restart your terminal after install.

  2. Now install the latest the latest LTS version of node:

npm & npx includeded

nvm install --lts

Note

To update node just run the command again.

One thing you'll have to remember when use NVM is that you'll need to explicitly specify the node version you want to use (installing does it automatically on the end of the install), so next time you'll login to ubuntu you'll need to run the command:

nvm use --lts

You can also add this command to the end of your .bash_profile file:

echo "nvm use --lts" >> .bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment