Skip to content

Instantly share code, notes, and snippets.

@JesterXL
Last active September 6, 2019 01:11
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 JesterXL/173e06c91ba8d48fba5edbff6c7be97d to your computer and use it in GitHub Desktop.
Save JesterXL/173e06c91ba8d48fba5edbff6c7be97d to your computer and use it in GitHub Desktop.

Installing Node.js

Optional: Install NVM

Node Version Manager allows you to quickly change Node.js versions which can be helpful to get the latest, but go back to the older version quickly if you need to.

  1. Install nvm by running curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
  2. Open your .bash_profile in your home directory. If you don't have one, cd ~ and run touch .bash_profile.
  3. Open it in a text editor and put:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

in there and save. 4. Close and re-open your Terminal. 5. Run nvm install stable and nvm use stable. 6. Test it out via node --version.

Binary

Download the binary installer and run it: https://nodejs.org/en/download/

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