How to install npm

Posted on

This is an article written just to show how to install npm. Basically the installation executed in the command line interface where the npm installed will be intended to be executed in the Linux operating system. Basically the installation of ‘npm’ itself is actually performed using a command executed in the terminal or any command line interface.

In an operating system based on Ubuntu Linux for an example, the installation is actually done by using a command executed in a command line interface. For a start, there is a certain command that can be executed to check whether an utiltiy called npm has already been installed or not. It can be retrieved from an information in an article titled ‘Ubuntu Search Installed Packages’ which exist in this link .

Based on the information retrieved, it can be shown below in order to search npm utility whether it has been installed or not :

root@hostname:~# apt list --installed | grep npm

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

node-npmlog/xenial,xenial,now 0.0.4-1 all [installed,automatic]
npm/xenial,xenial,now 3.5.2-0ubuntu4 all [installed]
root@hostname:~#

Check it with the proper command or the proper way in order to check whether npm has already been installed based on the operating system available.

But if the ‘npm’ utility hasn’t been installed, the right way to achieve it is only by installing npm utility. Below is the command execution of ‘npm’ utility as shown below :

apt-get -y install npm

The point is in order to be able to install ‘npm’ utility it is very easy. Prior to the installation of ‘npm’, first of all search it first :

root@hostname:~# apt-cache search npm
composer - dependency manager for PHP
mricron - magnetic resonance image conversion, viewing and analysis
node-github-url-from-git - Convert github git or gist url to an http url - Node.js module
node-npmlog - Logger with custom levels and colored output for Node.js
node-read-package-json - Read package.json for npm module for Node.js
node-slide - Simple chain and asyncMap flow control module for Node.js
node-tar - read and write portable tar archives module for Node.js
npm - package manager for Node.js
npm2deb - tool to help debianize Node.js modules
r-bioc-snpstats - BioConductor SnpMatrix and XSnpMatrix classes and methods
root@hostname:~#

There is an utility named ‘npm’ which can be seen and retrieved based on the online repository and it is a sign that a utility named ‘npm’ can be installed. In addition, the command above also inform the description of npm which is actually a package manager for Node.js. So,  just type ‘apt-get -y install npm’ to install npm in Ubuntu Linux.

Find out how to install npm in other Linux distribution using the appropriate package manager utility for installing npm.

3 thoughts on “How to install npm

Leave a Reply