Skip to content

Instantly share code, notes, and snippets.

@bhubr
Last active September 30, 2019 00:49
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 bhubr/52488c68917c3174d6e063a0bf0fd2bd to your computer and use it in GitHub Desktop.
Save bhubr/52488c68917c3174d6e063a0bf0fd2bd to your computer and use it in GitHub Desktop.

Installing Node.js

On Linux/MacOS

Note for Linux users: before going further, run which curl in the terminal. If it shows something (e.g. /usr/bin/curl), you're good! Otherwise, run sudo apt install -y curl (Ubuntu/Debian) to install cURL.

Note for zsh users (Linux or MacOS): in the following installation instructions, replace bash with zsh on the 1st line, and ~/.bashrc with ~/.zshrc on the 2nd.

You are going to use NVM (Node Version Manager). Here's a summary of what you have to do (see installation instructions on the NVM repo for more details). Run these commands in your terminal.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
nvm install v10.16.3
nvm use v10.16.3

You can verify that it worked by running node -v, which should display:

v10.16.3

On Windows

The original NVM doesn't support Windows. You're going to use NVM for Windows. Get to the releases page. Under the latest version (1.1.7 as of September 2019), download the nvm-setup.zip file (or use this direct link).

Extract the archive, and run nvm-setup.exe. Complete the setup wizard. Then, quit Git Bash if it is running, re-launch it, and type:

nvm install v10.16.3
nvm use v10.16.3

Running node -v should display: v10.16.3.

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