Skip to content

Instantly share code, notes, and snippets.

@Mr-Guilherme
Created September 7, 2021 12:54
Show Gist options
  • Select an option

  • Save Mr-Guilherme/282aa9708c318d306137a0e4b3b8536b to your computer and use it in GitHub Desktop.

Select an option

Save Mr-Guilherme/282aa9708c318d306137a0e4b3b8536b to your computer and use it in GitHub Desktop.
Commands to install Node LTS or Node Current

Node.js LTS

# For Ubuntu distribution
foo@bar: curl -fsSL http://deb.nodesource.com/setup_lts.x | sudo -E bash -
foo@bar: sudo apt-get install -y nodejs

Node.js Current

# For Ubuntu distribution
foo@bar: curl -fsSL http://deb.nodesource.com/current_lts.x | sudo -E bash -
foo@bar: sudo apt-get install -y nodejs

Using nvm library is much better

With nvm we can to manage several node versions.

To install:

foo@bar: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
# Or
foo@bar: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Usage:

# Check installation
foo@bar: nvm -v

# List local version
foo@bar: nvm ls

# List all available versions
foo@bar: nvm ls-remote

# Install node current
foo@bar: nvm install node

# Install any version node
foo@bar: nvm install 14.7.0 # or 10.10.9, 8.9.1

# Switch version after install
foo@bar: nvm use node #current
foo@bar: nvm use 14.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment