npm installation

NPM, Components, Uses and step by step guide for NPM installation

To begin with, NPM is used by every Javascript developer for code management and repository management. Although, during development or automation framework we need npm to install many automation packages and tools. Unquestionably, this tutorial helps you to understand what is NPM and why we use it. To put it another way, you will understand NPM installation.

NPM stands for Node Package Manager, which is an application and code repository Management, is world’s largest open source registry which is used by every continent developer to share and borrow packages also many organization use npm to manage private development as well.

NPM Components:

It provides three components, must be remembered:

  1. Website https://docs.npmjs.com/packages-and-modules/
  2. Command Line Interface (CLI)
  3. Registry
  1. Website: NPM website used to discover package and set up profiles and manage properties of NPM.
  2. Command Line Interface (CLI): As being a developer we all love CLI. CLI runs from command line.
  3. Registry:  is a large public database of Javascript softwares and meta information.

Uses of NPM:

Now that you know the components, with this purpose in mind, NPM is widely used for following purposes:

  1. Adapt packages of Code for your apps or incorporated packages  as they are
  2.  Download standalone tools
  3. Run packages without downloading using npx
  4. It is important to realize to share code with npm user
  5. Connect with Developer on same projects
  6. Restrict code to specific developer
  7. Manage versions of code and code dependencies
NPM libraries used for different application. This image explain the high level application of NPM libraries.
High level uses of NPM Repository

How to install NPM in Windows | NPM Installation

Provided that to install npm follow below steps:

Step 1: Open command prompt and type npm install npm@latest -g

Open command prompt and type npm install npm@latest -g
Install NPM From Command Line (CMD)

Step 2: Go to start and search “Environment System Variable”  and click on “Edit the System Environment Variables.

Search – Edit the system Environment Variables

Step 3: New Window Open and Click on Environment Variable:  

Click on "Environment Variables" to edit and add new.
System Properties Window

Step 4: Go to NPM installation directory and copy path upto bin folder

After NPM installation you find NPM documenty within nodejs folder
NPM Installation Directory

Step 5: Select on Path and click on Edit. Now add new Path Variable and give NPM directory path upto bin

Edit Path Variables

To add click on “New”, copy path and click on “OK”. Now all the settings applied.

This window is used to edit and add new path variables in Windows machine.
Edit Environment Variable

Step 6: To verify whether NPM is install properly, open command prompt and type npm-v. It will show installed NPM version else you need to install.

To check NPM installed version oepn command prompt or terminal and type "npm -v" and hit enter key. Installed NPM version will be displayed.
Check NPM Version

Great! Now NPM installed your machine. To conclude, we hope this tutorial helps you to understand NPM functionality and guide you in installations. Feel free to write your feedback on thoughtcoders2020@gmail.com

Comments

Emelia January 15, 2023

Hi there to all, how is everything, I think every one is
getting more from this site, and your views are pleasant in favor of new viewers.

Write A Comment