The complete interactive setup guide — pick your OS, follow the steps, and start building server-side JavaScript applications today.
Follow the step-by-step guide for your platform. Click each step to mark it complete.
https://nodejs.org/en/download
.msi file. Accept the license, keep defaults, and ensure "Add to PATH" is checked.# ✓ Check during install:
# - Automatically install necessary tools
# - Add Node.js to PATH (very important!)
C:\> node --version
v22.x.x
C:\> npm --version
10.x.x
mkdir my-app
cd my-app
npm init -y
Wrote to C:\my-app\package.json
server.js and run it to confirm everything works end-to-end.const http = require('node:http');
const server = http.createServer((req, res) => {
res.writeHead(200);
res.end('Hello World!');
});
server.listen(3000, () =>
console.log('Running on http://localhost:3000')
);
node server.js
Running on http://localhost:3000
# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL \
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Installing node...
✓ node 22.x installed successfully
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
# Restart terminal, then:
nvm install --lts
nvm use --lts
$ node --version
v22.x.x
$ npm --version
10.x.x
mkdir my-app && cd my-app
npm init -y
# create server.js then:
node server.js
Running on http://localhost:3000
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
source ~/.bashrc
nvm install --lts
sudo dnf install nodejs npm
node --version && npm --version
v22.x.x
10.x.x
mkdir my-app && cd my-app && npm init -y
✓ package.json created
Simulate common Node.js commands. Type a command below or click a quick command.
The key ideas that set Node.js apart from traditional server-side environments.
require()) and ES Modules (import). Use "type":"module" in package.json for ESM.npm init -y to generate it.The commands you'll use every day as a Node.js developer.
| Command | Description |
|---|---|
| npm init -y | Initialize a new project with default package.json |
| npm install <pkg> | Install a package and add to dependencies |
| npm install <pkg> -D | Install as a dev dependency (tests, build tools) |
| npm install -g <pkg> | Install package globally (CLI tools) |
| npm install | Install all dependencies from package.json |
| npm uninstall <pkg> | Remove a package |
| npm run <script> | Run a script defined in package.json |
| npm start | Run the start script (shorthand) |
| npm test | Run the test script (shorthand) |
| npm update | Update all packages to latest compatible versions |
| npm list | List installed packages in current project |
| npm outdated | Show packages with newer versions available |
| npm audit | Check for security vulnerabilities |
| npm publish | Publish your package to the npm registry |