</>
Skip to content
Node.js lessons (3/44)

Node.js — Get Started

Installation

Windows

Download from nodejs.org and run installer.

macOS

brew install node

Linux

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

Verify Installation

node --version
npm --version

First Script

// hello.js
console.log('Hello, World!');
console.log('Node.js version:', process.version);
node hello.js

package.json

npm init -y
{
  "name": "my-app",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "dev": "nodemon index.js"
  }
}

Running Scripts

node app.js              # Run file
node -e "console.log(1)" # Run code
node --watch app.js      # Watch for changes

Mini Practice

  1. Install Node.js
  2. Create and run a script
  3. Initialize a project with npm
  4. Use npm scripts

Up Next

Continue with REPL — the interactive JavaScript shell.

Related Topics

Frequently Asked Questions about Get Started

What is Get Started in Node.js?

Get Started is a fundamental concept in Node.js. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Get Started?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Get Started.

Why is Get Started important in Node.js?

Get Started is essential for Node.js development. Understanding this concept will help you write better code and solve real-world problems more effectively.