ubuntu node version code example

Example 1: linux install node

sudo apt install nodejs

Example 2: ubuntu 18 install nodejs

cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
nodejs -v # shows your version

Example 3: how to install nvm in ubuntu 18.04

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash# Alternatively $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Example 4: linux install node

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

Tags: