NPM is a javascript package manager for the Node JavaScript platform. The objective of this article is to install NPM on RHEL 8 / CentOS 8. To install NPM on RHEL 8 / CentOS 8 we will use the dnf install
command.
In this tutorial you will learn:
- How to install NPM on Rhel 8.
- How to search for modules using NPM.
- How to install modules using NPM.
- How to install modules form a Git repository.
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | RHEL 8 / CentOS 8 |
Software | npm 6.4.1 or higher |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – 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 |
How to install npm on RHEL 8 / CentOS 8 step by step instructions
- Use the
dnf
command to installnpm
package:# dnf install npm
- Check
npm
version to confirm the Npm installation:# npm --version 6.4.1
- Install modules using the
npm
command.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+https://git@github.com/visionmedia/express.git OR with SHH access $ npm install git+ssh://git@github.com/visionmedia/express.git