Interactive Setup Guide

Setup
Node.js

Your complete interactive guide to installing and configuring Node.js from scratch. Choose your OS, follow the steps, and start building.

Install Node.js

Select your operating system and follow the tailored installation commands.

Terminal โ€” zsh
# Install Homebrew (if not installed)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js via Homebrew
$ brew install node

# Verify installation
$ node --version
v22.14.0
$ npm --version
10.9.2

Build Your First App

Walk through each step interactively. Click a step to expand the details.

1

Initialize Your Project

Create a new directory and initialize a Node.js project with npm.

Terminal
$ mkdir my-app && cd my-app
$ npm init -y
Wrote to /my-app/package.json
2

Install Express.js

Add Express โ€” the most popular Node.js web framework โ€” to your project.

Terminal
$ npm install express
added 64 packages in 3s
โœ“ express@4.21.0 installed
3

Create Your Server

Write a minimal HTTP server that listens for requests.

server.js
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
res.send('Hello Node! ๐Ÿš€');
});

app.listen(PORT, () => {
console.log(`Running on port ${PORT}`);
});
4

Run & Test

Start the server and open your app in the browser.

Terminal
$ node server.js
Running on port 3000

# Open http://localhost:3000 in your browser
# You should see: Hello Node! ๐Ÿš€

Choose Your Tooling

Node.js supports multiple package managers. Compare them interactively.

๐Ÿ“ฆ

npm

The default package manager bundled with Node.js. Massive registry with 2M+ packages. Zero extra install needed.

๐Ÿงถ

Yarn

Created by Meta for speed and reliability. Supports Plug'n'Play mode for zero-install projects. Great monorepo support.

โšก

pnpm

Performant npm. Uses a content-addressable store that saves disk space and boosts install speed dramatically.

Essential Tools

The key libraries, frameworks, and tools every Node.js developer should know about.

๐ŸŒ

Express.js

Minimal, flexible web framework. The backbone of most Node.js APIs and web applications in production today.

๐Ÿ”„

Nodemon

Automatically restarts your server when file changes are detected. A must-have for development workflows.

๐Ÿ—ƒ๏ธ

Mongoose

Elegant MongoDB object modeling. Provides schema-based validation, middleware, and query building for your data.

๐Ÿ”‘

dotenv

Loads environment variables from a .env file into process.env. Keep secrets out of your source code.

๐Ÿงช

Jest

Delightful JavaScript testing framework. Zero-config setup with built-in coverage, mocking, and snapshot testing.

๐Ÿš€

PM2

Production process manager with built-in load balancer, log management, and zero-downtime deployments.

Setup Checklist

Track your progress. Click each item as you complete it.

๐ŸŽฏ Are you set up?

Complete these items to be fully ready for Node.js development.

โœ“
Node.js installed & verified (node --version)
โœ“
npm / yarn / pnpm working
โœ“
Code editor set up (VS Code recommended)
โœ“
Created first project with npm init
โœ“
Installed Express.js
โœ“
Built & ran a Hello World server
โœ“
Installed nodemon for dev workflow
โœ“
Set up .gitignore for node_modules
0 / 8 complete

Common Questions

Quick answers to the most frequently asked questions about Node.js setup.

Node.js is the JavaScript runtime that lets you run JavaScript outside a browser. npm (Node Package Manager) is the tool that comes bundled with Node.js for installing, managing, and sharing reusable code packages.

For most users, the LTS (Long Term Support) version is recommended. It receives security updates for 30 months and is the most stable choice. The Current version has the latest features but may have breaking changes.

Use a version manager like nvm (Node Version Manager) on macOS/Linux or nvm-windows on Windows. These tools let you install and switch between multiple Node.js versions effortlessly with commands like nvm use 20.

package.json is your project's manifest file. It records metadata (name, version), lists all dependencies, defines scripts (like start, test, build), and allows anyone to reproduce your project environment with a single install command.

No. Always add node_modules/ to your .gitignore file. The folder can contain thousands of files and is fully reproducible from your lockfile (package-lock.json or yarn.lock) by running the install command.