Node and npm
What this is
Node.js lets your computer run JavaScript outside of a browser.
npm is the package manager that comes with Node. It installs the libraries your project depends on.
Why it matters
Every modern web project — React, Next.js, Vite, Astro — needs Node to run locally.
When you run npm run dev, Node starts a local server on your computer so you can see the project in a browser before it is deployed. Without Node, you cannot run the project at all.
npm handles the dependencies. When you clone a project or scaffold one with AI, it will have a package.json file listing everything the project needs. Running npm install downloads all of it.
What to do
Install Node.js
Always install the LTS version (Long Term Support). It is the stable version recommended for most projects.
Download from nodejs.org.
After installing, close and reopen your IDE terminal, then check:
node -v
npm -vYou should see version numbers for both. Something like:
Reference
v20.11.0
10.2.4If you see nothing or an error, close the terminal completely and reopen it.
What the key commands do
| Command | What it does |
|---|---|
npm install | Downloads all packages listed in package.json |
npm run dev | Starts the local development server |
npm run build | Builds the production version of the project |
npm run start | Runs the production build locally |
You will use npm install and npm run dev in almost every session.
The node_modules folder
When you run npm install, it creates a node_modules folder. This folder can be very large — sometimes hundreds of megabytes.
Do not commit node_modules to Git. A properly set up project will have a .gitignore file that excludes it automatically.
If you clone a project and it does not run, the first thing to try is:
npm installThis downloads the missing packages.
What package.json is
package.json is the project's manifest. It lists:
- The project name and version.
- The scripts you can run (like
dev,build,start). - The packages the project depends on.
When AI generates a project for you, it will create a package.json. Read it before running anything — it tells you exactly what the project is using.
Local development flow
npm install -> npm run dev -> open browser at localhost:3000 (or the port shown)The terminal will show the local URL after npm run dev starts. Usually it is:
Checkpoint
http://localhost:3000Keep the terminal open while you work. Closing it stops the local server.
Common mistakes
- Installing Node but not restarting the terminal before checking
node -v. - Running
npm run devbefore runningnpm install— the project will fail. - Closing the terminal while the dev server is running.
- Committing
node_modulesto Git — always check.gitignoreexists. - Installing the Current version of Node instead of LTS — stick to LTS for stability.
Vibe 101 / Current checkpoint
Node and npm
Ready to stamp - Saved in this browser only.
0 of 20 checkpoints complete.