Node.js is a JavaScript runtime built on chrome’s V8 engine. It is efficient and lightweight as it uses a non-blocking, event-driven Input/Output model. npm or the Node.js’ package system is amongst the biggest open source libraries.
Source: https://www.ubuntu.com/
To use Node.js, you must first install it. In this article, I will share 6 easy, time-saving steps to quickly install Node.Js on Ubuntu. It will cover the Node.js installation on both Ubuntu Desktop and Ubuntu server distribution for following versions:
- Trusty Tahr (14.04)
- Xenial Xerus (16.04)
- Precise Pangolin (12.04)
- Yakkety Yak (16.10)
Note: Make sure that your system meets following requirements:
Your environment is a supported architecture:
- i386 (32-bit)
- amd64 (64-bit)
- armhf (ARM 32-bit hard-float, ARMv7 and up: arm-linux-gnueabihf)
Your environment is using a supported Ubuntu LTS distribution:
- Ubuntu 12.04 LTS (Precise Pangolin)
- Ubuntu 14.04 LTS (Trusty Tahr)
- Ubuntu 16.04 LTS (Xenial Xerus)
- Ubuntu 16.10 (Yakkety Yak)
Let’s proceed with the installation steps: -
Step 1:- First step to install Node.Js is to run the install curl command
sudo apt-get install curl
Step 2: - Then, run the following 2 commands
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
$ sudo apt-get install -y nodejs
The first command will add the Node source APT repository for Debian-based distribution repository and the PGP key for verifying packages and the second command will install the Node.js from the Debian-based distribution repository.
Step 3: - Use the following command to download and setup the APT repository and add the PGP key to the system’s APT key chain.
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
Step 4: - By this time, we have set the APT repository and can now install the Node.js with apt-get by using the following command.
$ sudo apt-get install -y nodejs
Step 5: - You can check the Node type by using the following command
$ node v //prints node version
Step 6: - Update the npm version by using the following command
$ sudo npm install npm global
After this 6 step installation process, you are good to go. How did you find the article? Share your thoughts and concerns in the comments section below.
0 Comment(s)