fbpx

Node Installation Procedure on Ubuntu

Method 1

Install nodeJs using ubuntu official repository

Here user can Install the default version of the installed ubuntu version

Step 1: Open your terminal or press Ctrl + Alt + T

Step 2: To install node.js use the following command:

sudo apt install nodejs

Step 3: Once installed, verify it by checking the installed version using the following command:

node -v or node –version

Note: It is recommended to install Node Package Manager(NPM) with Node.js.It is an open source library for node js

sudo apt install npm

npm -v or npm –version

Method 2

Install node using NodeSource Repository on ubuntu

Here the user can install the desired version.

Step 1: Open your terminal or press Ctrl + Alt + T and use the following commands to update and upgrade the package manager:

sudo apt-get update

sudo apt-get upgrade

Step 2: Install Python software libraries using the following command:

sudo apt-get install python-software-properties

Step 3: Add Node.js PPA to the system.

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

Note: Here, we are installing node.js version 10, if you want to install version 11, you can replace setup_10.x with setup_11.x.

Step 4: To Install Node.js and NPM to your Ubuntu machine, use the command given below:

sudo apt-get install nodejs

Step 5: Once installed, verify it by checking the installed version using the following command:

node -v or node –version

npm -v or npm –version

Finally, you have successfully installed Node.js and NPM on your Ubuntu machine.

Install node version manager on ubuntu

  • Open terminal
  • wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
  • export NVM_DIR=”$HOME/.nvm”
  • [ -s “$NVM_DIR/nvm.sh” ] && \. “$NVM_DIR/nvm.sh”
  • [ -s “$NVM_DIR/bash_completion” ] && \. “$NVM_DIR/bash_completion”
  • Execute  
  • nvm install 8
  • nvm install 12.20.2
  • To switch from one version to another use the command
  • nvm use 12.20.2

Leave a comment