- Open a new shell and type wsl.
- Type
cd ~/../../
. - Type
sudo apt-get update
- Copy these two lines and paste them into the terminal:
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
The first line will handle getting everything ready. The second line will show up once the first line has finished. Press enter when the second line shows up in your terminal.
- Close the window and open a new shell, and type wsl as usual.
- Type
node -e 'console.log("works")'
- If you get a response back that says
works
then you're all good to go!