Protractor Tutorial 6 – Introduction & Installation of NPM – Node Package Manager

Hello Folks,

In last post, we have seen about Introduction & Installation of NodeJS. In this post we will see about Introduction & Installation of NPM.

You must have heard of Maven and Maven Central Repository. Maven is a build automation tool for Java projects. A major use of Maven to install/download Java libraries dynamically on which your project depends. You can relate the same with NPM. Major difference between these two is that Maven is for Java libraries while NPM is for JavaScript and NodeJS libraries.

NPM stands for Node Package Manager which can be used to install, share and manage NodeJS and JavaScript libraries. In fact we can do more with NPM. Like Maven Central Repository we have NPM website to discover packages. NPM provides a Command Line Interface (CLI) to interact with it. This CLI can be used to install, uninstall, update or manage packages.

Installation of NPM:-

NPM comes with NodeJS. So when you install NodeJS in your system, NPM is also getting installed automatically. Installation of NodeJS we have seen already. Let’s check if NPM is also installed.

Run below command in terminal:-

npm -v or npm –version

We can also check where(directory) npm is installed. If you are using windows use “where npm”. If you are using linux or mac use “which npm” command to check installation directory of npm. You can see npm is inside nodejs.

NPM is a separate project from Node.js. It means we will have different versions of NPM and NodeJS. NPM tends to update more frequently. So if you want to update NPM run below command in terminal:-

npm install npm@latest -g

You can see earlier I had installed NPM version as 6.4.1 which is now 6.9.0.

Run npm -help to see usage of npm. We will see some more basic concepts of npm in upcoming posts.

More on Protractor in upcoming posts. Stay tuned and keep learning with me.

#ThanksForReading

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

Leave a Reply

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.
%d bloggers like this: