JS runtime env
- To run JS outside the browser.
- Built on Chrome’s V8 engine.
- Comes with built-in modules (like
fs, http, path).
- It’s the engine to executes JS on servers or local machine.
Install Node.js
# shows Node.js version
node -v
# shows npm (Node Package Manager) version
npm -v
Frontend-only (React)
- If app is just a React frontend (no backend code,)
- Just need nodejs to build the app
- This produces static files (
index.html, bundle.js, CSS, assets).
- You can host these files anywhere: Vercel, Netlify, Cloudflare Pages, GitHub Pages, etc.
npm run build
Frontend + Backend (Full-stack)
- If write a backend using Node.js (Express, NestJS, or just APIs):
- You need a machine with Nodejs runtime.
- To host Node.js backend project.
- Options: AWS EC2, Render, Railway, Vercel Serverless Functions, etc.