BACK TO THE HOMEPAGE

Apr 05, 2021 2 min read

Install Node

Node.js Installation

The Node.js programming language is an open source project to make programmers more productive.

Node.js is flexible and easy to learn. Its wide adoption is primarily down to the universal nature of the language. If you have a web browsers such as Google Chrome, it comes with a very rudamentary development environment as part of dev tools. The web is already available everywhere, so why not learn the language of the web? JavaScript is very quick to learn. If you want to move beyond that to topics such as Node.js, and Express, JavaScript is an ideal language. In most cases, having this language in your arsenal will be very useful to build quite powerful applications.

Check out the available NodeJS distributions. Consider the target environment for the application to be built.

  • If you need to integrate with other solutions, it is often not useful to go with the bleeding edge version.
  • If you have a greenfield project, select the latest long term support (LTS) version.

Configuration

Download the application from the NodeJS repository e.g..

NODE_TYPE // bash
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh

Run the script to install Node

NODE_TYPE // bash
sudo bash nodesource_setup.sh

Follow the onscreen instructions:

NODE_TYPE // bash
sudo apt-get install -y nodejs

Install Yarn

NODE_TYPE // bash
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

Dependencies: It may be necessary to install additional packages

NODE_TYPE // bash
sudo apt install -y build-essential libssl-dev

Test Installation

Confirm the install of NodeJS by checking the version

NODE_TYPE // bash
node -v

Confirm the installation of the npm package manager

NODE_TYPE // bash
npm -v 

Development

NODE_TYPE // bash
npm init --yes