Installation of Node JS on Linux

Node.js is a powerful JavaScript runtime powered by Chrome's V8 engine. On Ubuntu Linux systems, it can easily be installed through the NodeSource repository to ensure access to the latest version. Hostinger's VPS offers an excellent environment for Node.js applications, granting users control and flexibility. They provide convenient templates for effortless Node.js setup on Ubuntu 22.04, complete with Node.js and an OpenLiteSpeed server. Moreover, they offer a CloudPanel template, which streamlines the creation and management of Node.js apps through a user-friendly interface, making it accessible even for those with limited VPS experience.


Installing Node On Ubuntu 18.04 and 16.04:

There are two methods Ubuntu official repository and NodeSouce repository to install Node.js on Ubuntu.

Install Node JS using Ubuntu official repository:

Node.js is available in Ubuntu’s repository and you can easily install it using a few commands. Follow the steps below to install Node.js on your Ubuntu operating system.

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

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

version

Note: It is recommended to install Node Package Manager(NPM) with Node.js. NPM is an open source library of Node.js packages. To install NPM, use the following commands:

sudo apt install npm 
npm -v or npm --version

Node and NPM will be successfully installed on your Ubuntu machine.   

Install Node JS using NodeSouce repository:

The latest version of Node JS can be installed from NodeSource repository

Follow the steps below to install the Node.js on your Ubuntu.

Step 1: Open your terminal or press Ctrl + Alt + T and use the following commands:

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 --versionnpm -v or npm --version

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

If you have better suggestions about the products/services/tools/brands listed above or feel like something missing, please Contact Us and share your suggestions.

No comments:

Post a Comment