30 C
Jaipur
Wednesday, October 21, 2020

Install npm Linux Mint 20 – Linux Hint

Must read

Netflix StreamFest: Free Netflix And Chill For A Weekend

After killing its 30-day free trial, Netflix is bringing StreamFest to give users a free weekend of its streaming services. First reported by Protocol,...

DJI Pocket 2 is a Tiny Vlogging Camera with a Modular Design, Improved Audio

Renowned drone maker, DJI, has upgraded its tiny gimbal camera for bloggers today. The company has launched the DJI Pocket 2, a successor to...

Safari Among Seven Mobile Browsers Affected by Address Bar Spoofing Vulnerabilities

Researchers at cyber-security firm, Rapid7, have claimed that several popular mobile browsers are vulnerable to ten new ‘Address Bar Spoofing’ vulnerabilities, thereby jeopardizing the...

Jio and Qualcomm Begin 5G Network Trials in India; Achieves Over 1Gbps Speeds

Reliance Jio, the leading telecom operator in India, first talked about its 5G ambitions and the use of in-house stack at its AGM earlier...

Whenever we are working in any run-time environment, we always need a good package manager that can handle the installation of all the related packages very gracefully. npm refers to the default package manager of Node.js which is the run-time environment for JavaScript. Before installing npm, we must have Node.js environment ready for us. Therefore, in this article, we will walk you through the method of installing npm in Linux Mint 20.

Methods of installing npm Linux Mint 20:

For installing npm on Linux Mint 20, you can make use of any of the two methods discussed below:

Method # 1:

For installing npm on Linux Mint 20 from NodeSource, you will need to perform the following steps:

  • Launch the terminal in Linux Mint 20 by clicking on the terminal icon located on your taskbar. The newly launched terminal window is shown in the image below:
  • Now you need to enable the NodeSource repository. For doing that, type the following command in your terminal and then press the Enter key:

curl –sL https://deb.nodesource.com/setup_12.x | sudo -E bash

This command is also shown in the following image:

  • Once the NodeSource repository has been successfully enabled, your terminal screen will look something like this:

  • Now you need to install the nodejs package which contains binaries for both npm and node. For doing that, type the following command in your terminal and then press the Enter key:

This command is shown in the image below:

  • Once all the binaries within this package have been installed successfully, you will be able to see the output shown in the following image:

  • Now you need to verify if Node.js has been successfully installed on your system or not. For doing that, type the following command in your terminal and then press the Enter key:

This command is also shown in the image below:

  • The Node.js version is shown in the following image:

  • For verifying the npm version, type the following command in your terminal and then press the Enter key:

This command is shown in the image below:

  • The npm version is shown in the following image:

Method # 2:

For installing npm on Linux Mint 20 by making use of Linux Repository, you will need to perform the following steps:

  • Launch the terminal in Linux Mint 20 in the same way as it is described in the method above. Now type the following command in your terminal for updating your Linux repository and then press the Enter key:

This command will take some time to execute as it requires updating all the necessary packages before installing a new one. It is shown in the image below:

  • As soon as all the necessary packages have been updated in your Linux repository, you will be able to see the following output on your Linux Mint 20 terminal:

  • Now type the following command in your terminal for installing the nodejs package which contains binaries for npm as well as for Node.js and then presses the Enter key:

This command is shown in the image below:

  • Once the nodejs package has been successfully installed, you will be able to see the following output on your terminal:

  • For verifying if Node.js and npm have been successfully installed or not, you can simply run the respective version commands as described in the method above. Now if you want to enable ad-ons from npm, you will need to install the development tools. For doing that, type the following command in your terminal and then press the Enter key:

sudo apt install build-essential

This command is also shown in the image below:

  • As soon as the development tools will be installed successfully, you will be able to see the following output on your Linux Mint 20 terminal:

Conclusion:

By making use of any of the two methods discussed in this article, you can easily install npm on Linux Mint 20. Both these methods are extremely simple and convenient to follow and work fine in all situations. Therefore, it is only a matter of your own choice which method you decide to follow.

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Netflix StreamFest: Free Netflix And Chill For A Weekend

After killing its 30-day free trial, Netflix is bringing StreamFest to give users a free weekend of its streaming services. First reported by Protocol,...

DJI Pocket 2 is a Tiny Vlogging Camera with a Modular Design, Improved Audio

Renowned drone maker, DJI, has upgraded its tiny gimbal camera for bloggers today. The company has launched the DJI Pocket 2, a successor to...

Safari Among Seven Mobile Browsers Affected by Address Bar Spoofing Vulnerabilities

Researchers at cyber-security firm, Rapid7, have claimed that several popular mobile browsers are vulnerable to ten new ‘Address Bar Spoofing’ vulnerabilities, thereby jeopardizing the...

Jio and Qualcomm Begin 5G Network Trials in India; Achieves Over 1Gbps Speeds

Reliance Jio, the leading telecom operator in India, first talked about its 5G ambitions and the use of in-house stack at its AGM earlier...

US Justice Department Files Antitrust Lawsuit Against Google

The US Justice Department on Tuesday filed an antitrust lawsuit against tech giant Google. It alleges that Google is abusing its dominance in the...