3. Installing Node.js & Running Your First Program

Before building applications with Node.js, we need to install it and set up our environment. In this article, you will learn how to install Node.js and run your very first program.

Node.js installation guide

1. Downloading Node.js

Download the LTS (Long Term Support) version for stability.

  • LTS → Stable
  • Current → Latest features

2. Installing Node.js

  1. Open installer
  2. Click Next
  3. Accept license
  4. Finish

npm is installed automatically.

3. Verifying Installation

node -v
npm -v

Output:

v20.x.x
10.x.x

4. First Program

console.log("My first Node.js program");

5. Run Program

node app.js

Output:

My first Node.js program

6. What Happened?

  • Node executed JS file
  • V8 converted to machine code
  • Output printed

7. Using REPL

node
2 + 2

Output: 4

8. Mistakes

  • Node not recognized
  • Wrong folder
  • Wrong extension

Conclusion

Your system is ready for Node.js development 🚀

Chakrapani U

Hi, I’m Chakrapani Upadhyaya, an IT professional with 15+ years of industry experience. Over the years, I have worked on web development, enterprise applications, database systems, and cloud-based solutions. Through this blog, I aim to simplify complex technical concepts and help learners grow from beginners to confident, industry-ready developers.

Previous Post Next Post

نموذج الاتصال