how to run hello world program in node.js

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.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.