DEV Community

Cover image for What is NPM?
Ahmed Mohamed
Ahmed Mohamed

Posted on

What is NPM?

Introduction

If you are Front End or Back End developer It is sure to have been used NPM (Node Package Manager) at least once in your projects, so in this series, we will talk about NPM and we will cover those topics:

  1. Install NPM
  2. package.json file
  3. Install NPM Packages
  4. Versions in NPM Packages
  5. Dealing with NPM Packages
  6. Update Existing Packages
  7. Uninstall NPM Packages
  8. Create and Publish Your Own NPM Package.
  9. Update the published NPM Package.

And now let's begin in the first section.


What is NPM?

NPM is a Package Manager which allows to developers shear their packages between them and use these packages in their projects, and it is a default package manager for JavaScript Run time environment Node JS.

At this article time, NPM contains 1,873,569 Package Which allows him to be the most famous package manager.

NPM consists of two main parts:

  1. CLI Tool to deal with packages in the projects.
  2. Online repository that hosts javascript package.

Installing NPM

To install NPM in our machine we should Install Node JS and NPM will be downloaded with it, so first we will download Node Js:
Open the Node JS website and download it.
Setup Node JS like any program on your PC.
After that open your terminal and type this commands:

> node --version 
v16.13.2
Enter fullscreen mode Exit fullscreen mode
> npm --version
8.1.2
Enter fullscreen mode Exit fullscreen mode

And now Node JS and NPM are available in our Machine and we can use them in our projects.

We will notice that the Node version differs from NPM Version and this is normal because they 2 totally different pieces of software and evolve separately.

In this section, we talked about what is NPM and how we can install it in our machine to use it in our projects, and in the next article, we will talk about the package.json file in detail.
So See you in the Next Section...🖐️

Top comments (0)