In last post, we have seen about Introduction & Installation of NodeJS. In this post we will see about Introduction & 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.