📦

Node.js & npm/pnpm

🧑‍🍳 Cook

JavaScript outside the browser

Node.js lets you run JavaScript on servers, scripts, and CLI tools.


Installation

SystemCommand
macOSbrew install node
Windowswinget install OpenJS.NodeJS
Linuxsudo apt install nodejs npm
# Verify installation
node --version
npm --version

npm vs pnpm vs yarn

ManagerSpeedSpaceCommand
npmNormalNormalnpm install
pnpmFastEfficientpnpm install
yarnFastNormalyarn

💡 Recommendation: pnpm for new projects.

# Install pnpm
npm install -g pnpm

Create project

# Initialize
mkdir my-project && cd my-project
pnpm init

# Add dependency
pnpm add express

# Add dev dependency
pnpm add -D typescript @types/node

package.json

{
  "name": "my-project",
  "version": "1.0.0",
  "scripts": {
    "dev": "node index.js",
    "build": "tsc",
    "start": "node dist/index.js"
  },
  "dependencies": {
    "express": "^4.18.0"
  },
  "devDependencies": {
    "typescript": "^5.0.0"
  }
}
# Run scripts
pnpm dev
pnpm build

Example: Basic server

import express from 'express'

const app = express()
app.get('/', (req, res) => res.send('Hello!'))
app.listen(3000, () => console.log('http://localhost:3000'))

Practice

REST API with Express


Useful links

Want to go further?

This is one piece. GenAI Builder is the whole map.

Ten domains, from the terminal to energy and law, five levels earned with real evidence and an AI mentor. At your own pace, in English and Spanish.

See the courseLifetime access · 30-day guarantee

© 2026 luxIA.us - All rights reserved

Created by Alann Reyes