Hello Getting Started Nodejs With Example : In this tutorial we will learn how to install nodejs and create node project and run by command line on console or localhost.
Step 2 :- when you done with installation process, then you have to start command prompt and go to the current directory where you installed nodejs and check nodejs version with following command :
If you will get v4.1.0 or v(any version) on your cmd means you successfully installed nodejs.
After that you have to check npm [ node package manager ] version using command line below command.
If you will get version means you successfully installed nodejs set up with npm.
Now you can create hello.js file and check and run that file with following command with following code.
create one file in our installed node directory with name hello.js and put over their following code :
and again go to the command line and run following command :
If you will get result Hello World so you run your first nodejs code from command line.
Now you need to check your hello.js file output on your browser so that you have to follow following code:
Again run from command prompt with :
Then go to your browser and type http://localhost:8080/ and go. You will get result on your browser
I think you understand the basic need of nodejs.