Node.js Get Started

Install Node and run a script.

✍️ 2 exercises in this lesson
  1. Download the LTS version from nodejs.org and install it.
  2. Check it: node -v and npm -v
  3. Create app.js and run it with node app.js.
  4. Type node alone to open the interactive REPL.

Use node --watch app.js to restart automatically when the file changes.

Key Takeaways: Node.js Get Started

Mastering Node.js Get Started helps you write clean and reliable Node.js code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

Node.js Get Started Code Example

Node.js
// app.js
const name = process.argv[2] || "World";
console.log(`Hello, ${name}!`);

// Run:  node app.js Sara
Output
Hello, Sara!
Run this example on your own computer. The "Get Started" lesson shows how to set it up.

Node.js Get Started Practice Exercises

Check what you learned in “Node.js Get Started”.

/ 2 solved
Fill in the blank

Restart automatically when files change (Node 18+).

node  app.js
✓ Correct! Not quite. Try again.
Multiple choice

Which version should you install for production use?

✓ Correct! Not quite. Try again.
to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services