Getting Started Nodejs With Example

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 1 :- First you need to download nodejs set-up from here https://nodejs.org/dist/v4.2.1/ you can get all OS compatible nodejs setup. just download it and install setup in your system.

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

Hello World

hello-world nodejs
hello-world nodejs

I think you understand the basic need of nodejs.

Leave a Reply

Your email address will not be published. Required fields are marked *