🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to Node.js Notes
Topic #3

Node Get Started


Download and Install Node.js

  1. Go to https://nodejs.org
  2. Download the LTS (Long Term Support) version
  3. Run the installer and follow the instructions

Verify Installation

Open your terminal/command prompt and type:

node --version
npm --version

You should see version numbers for both Node.js and npm (Node Package Manager).


Troubleshooting

If the commands don't work:

  • Restart your terminal/command prompt
  • Make sure Node.js was added to your system's PATH during installation
  • On Windows, you might need to restart your computer

Getting Started

Once you have installed Node.js, let's create your first server that says "Hello World!" in a web browser.

Create a file called myfirst.js and add this code:

let http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);

Save the file on your computer, for example: C:\Users\Your Name\myfirst.js

This code creates a simple web server.

When someone visits your computer on port 8080, it will show "Hello World!".


Command Line Interface

Node.js files must be initiated in the "Command Line Interface" program of your computer.

How to open the command line interface on your computer depends on the operating system.

For Windows users, press the start button and look for "Command Prompt", or simply write "cmd" in the search field.

Navigate to the folder that contains the file "myfirst.js", the command line interface window should look something like this:

C:\Users\Your Name>_

Initiate the Node.js File

The file you have just created must be initiated by Node.js before any action can take place.

Start your command line interface, write node myfirst.js and hit enter:

C:\Users\Your Name>node myfirst.js

Now, your computer works as a server!

If anyone tries to access your computer on port 8080, they will get a "Hello World!" message in return!

Start your internet browser, and type in the address: http://localhost:8080

Want to go beyond the notes?

Join CodingNow 2.0's Node.js course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Node Get Started – FAQs

Quick answers about learning Node Get Started in Node.js.

This free note from CodingNow 2.0 explains Node Get Started in Node.js — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Node.js topic on CodingNow 2.0, including Node Get Started, is 100% free with no signup required.
With focused practice, most students grasp Node Get Started in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now