Monday, 4 May 2015

Installing Node.js and NPM on Windows

1. Download Node.js installer from https://nodejs.org/download


2. Run the installer (i.e. msi file )








Once installation is completed, restart your computer.
 
After your computer is restarted, check the Node.js and NPM versions by executing the below simple commands on Windows command prompt.

Test Node.js Version:
Type 'node -v' in command prompt and press enter key.


Test NPM Version:
Type 'npm -v' in command prompt and press enter key.

  

Print 'Hello world' in console.


Prerequisite:
Node.js and NPM is installed.

Add 'console.log('Hello world');' and save the file as 'Hello.js'


To run 'Hello.js', open the command prompt and navigate to folder location of 'Hello.js'.

In command prompt type 'node Hello.js' and press enter key.

No comments:

Post a Comment