How To Install Node.js And NPM Using NodeSource Repository

 In this tutorial you will learn how to install Node.js And NPM Using NodeSource Repository.


How To Install Node.js And NPM Using NodeSource Repository

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment built on Chrome's JavaScript. Node.js is designed to execute JavaScript code outside a Web browser. Node.js runs on a JavaScript Engine (i.e. V8 engine). Node.js is generally used to build fast and scalable server-side and networking applications. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

The Node.js distributed development project was previously governed by the Node.js Foundation, and has now merged with the JS Foundation to form the OpenJS Foundation, which is facilitated by the Linux Foundation's Collaborative Projects program.

Original author: Ryan Dahl
Developer: OpenJS Foundation
Initial release: May 27, 2009
Stable release: 18.9.0/ September 8, 2022
Repository: github.com/nodejs/node
Written in C, C++, JavaScript
Operating system: Linux, mcOS, Windows, etc.
Type: Runtime environment
License: MIT License
Website: nodejs.org

Installing Node.js and NPM From NodeSource

NodeSource is a company focused on providing enterprise-grade Node support. It maintains an APT repository containing multiple Node.js versions. Use this repository if your application requires a specific version of Node.js.

Follow the below steps to install Node.js through Nodesource:

  1. Open terminal (Ctrl+Alt+T)
  2. Execute following command to update package manager list:
$ sudo apt update
  1. Enter your sudo or user password and press Enter key.
  2. Install Python software libraries using the following command:
  $ sudo apt install python-software-properties
  1. Add Node.js PPA to the system:
$ curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -

NOTE: If you need another Node.js version, for example, 16.x, change the setup_18.x with setup_16.x.

  1. To install Node.js and NPM to your Linux machine, use the command given below:
$ sudo apt install -y nodejs
  1. Verify the Node.js and NPM version:
$ node --version

OR

node -v

Output:

v18.7.0
$ npm --version

OR

$ npm -v

Output:

8.15.0

F

Post a Comment

0 Comments