how to run hello world program in node.js

Prem Tiwari - - Node.js Tutorial


NodeJs is the trending technology these days. NodeJS is an open source and server-side programming. In this tutorial, I am going to share how to run hello world program in node.js with the output.

how to run hello world program in node.js

First, you need to install nodejs in your machine to run the nodejs application. Here is details tutorial:

How to run hello world program in node.js

Create a file “index.js” inside any folder and copy paste below code and save it.

1. Now open the command window and navigate to your working directory using cd command.

2. Run node index.js command to run your program.

nodejs hello world application

3. Open “http://localhost:8080/” in your browser to see the program output.

localhost 8080

Nodejs program on Command Line Interface

1. Copy the below code and paste it in index.js page.

2. Run node index.js command to see the output.

command line nodejs

If you like this tutorial, do like and share with your friends on social media sites and don’t forgot to subscribe our blog to get latest tutorials inside your mail box.


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.