Install NPM on Ubuntu 18.04 Bionic Beaver Linux


The objective of this article is to install NPM on Ubuntu 18.04 Bionic Beaver. NPM is the package manager for JavaScript.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver
  • Software: – 3.5.2 or higher


Privileged access to your Ubuntu System as root or via sudo command is required.




  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user


Install NPM on Ubuntu

The following linux command will install NPM on the Ubuntu 18.04 system. It is also recommended to install NPM alongside with the build-essential package in case that NPM encounters a source package during module installations:

$ sudo apt install npm build-essential

Check for NPM version:

$ npm --version

Use NPM to install JavaScript module

To search all available modules with NPM enter:

$ npm search KEYWORD

To perform a module installation with NPM run:

$ npm install MODULE-NAME

To install a JavaScript module directly from GIT repository execute NPM with the URL of the actual module you wish to install.

For example the bellow command will install the express module from its home git repository:

$ npm install git+
OR with SHH access
$ npm install git+ssh://