Install Node

Share on:

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..

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

Run the script to install Node

1sudo bash nodesource_setup.sh

Follow the onscreen instructions:

1sudo apt-get install -y nodejs

Install Yarn

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

Dependencies: It may be necessary to install additional packages

1sudo apt install -y build-essential libssl-dev

Test Installation

Confirm the install of NodeJS by checking the version

1node -v

Confirm the installation of the npm package manager

1npm -v 

Development

1npm init --yes