A node package manager is used to automatically install, update, configure and remove software packages. There are several tools available on the market for this purpose, I will discuss in this article one of the most popular systems which is npm.
What is NPM?
As I mentioned in the introduction, NPM is a node package manager system for automatic installation, updating, configuration and removal of packages. NPM has more than 800 thousand packages in its database and this number is growing more and more every day.
NPM is installed together with Node JS and without it we are unable to perform npm installation.
- We go to the official Node JS website and choose the appropriate installer for our operating system. Currently, NPM is supported for systems such as Windows, Linux and macOS.
- Once the download is complete, we run the installer and follow the instructions in the installer.
- After installation, sometimes a reboot of the computer is required.
- To check if we have successfully installed Node JS along with NPM, type the following command in the console:
With this command we are able to check the version of installed Node JS. Analogically, to check the version of NPM we use the command:
How does NPM work?
This system downloads the package and its dependencies we are interested in, NPM installations can be run with or without arguments. Run without arguments, NPM downloads the dependencies and defines them in the package.json file and creates the node_modules folder with the packages we have installed.