NPM Installation and Environment Set Up

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

NPM is used by every Javascript developer for code management and repository management. During development or automation framework we need npm to install many automation packages and tools. This tutorial helps you to understand what is NPM and why we use it.

NPM stands for Node Package Manager, which is an application and code repository Management. NPM 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:

NPM provides three components

  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:

NPM 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. 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?

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 installed properly or not, 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. Hope this tutorial helps you to understand NPM functionality and guide you in installations. Feel free to write your feedback on thoughtcoders2020@gmail.com

0 0 vote
Article Rating
close

Subscribe to our Newsletter:

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Open chat
Feel free to contact