Skip to content

Instantly share code, notes, and snippets.

@h4de5
Created December 4, 2018 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4de5/51c66d35cb9cecf080a11c967d78fc2f to your computer and use it in GitHub Desktop.
Save h4de5/51c66d35cb9cecf080a11c967d78fc2f to your computer and use it in GitHub Desktop.
Install nodejs with npm support on WSL (Bash for windows)
#!/bin/bash
# have a look here: https://github.com/creationix/nvm
# will install it into ~/.nvm/
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# restart bash
# list available nodejs versions
nvm ls-remote
# take on of the latest once (does not need to fully match)
nvm install v10
# set default node to installed version
nvm alias default v10
# congrats - you got node and npm now
node -v
# v10.14.1
npm -v
# 6.4.1
# its also possible to install multible nodejs versions and switch between them using nvm
# but for now i am happy with this setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment