Skip to main content
Vibe Code Forum

Article: Node.js and npm: what they are and why you need them

If you build web apps with AI, you will be told to "install Node" within the first ten minutes. Here is what that means.

What they are

  • JavaScript is the language of web pages. It normally runs inside a browser.
  • Node.js lets JavaScript run on your computer or a server, outside the browser. Most modern web tools (React, Next.js, Vite, Expo) need it to build and run projects.
  • npm (Node package manager) comes with Node. It installs packages: code written by others that your project uses. Alternatives such as pnpm, yarn and bun do the same job.

The files you will see

  • package.json: the project's name, the packages it needs, and scripts such as dev, build and start.
  • package-lock.json (or a similar lock file): the exact versions installed. Commit it to Git.
  • node_modules/: the downloaded packages. Huge, never commit it (it should be in .gitignore), and safe to delete; npm install brings it back.

The commands

node --version     is Node installed, and which version?
npm install        install everything listed in package.json
npm run dev        run the "dev" script: usually starts the app at a local address
npm run build      make the production version
npm install zod    add a new package to the project

When npm run dev prints an address like https://vibecodeforum.com, open it in your browser to see your app. Only you can see it; nobody else can reach your computer's localhost.

Installing Node

Use the LTS (long-term support) version from the official Node.js site, or a version manager such as nvm if you'll juggle several projects. Close and reopen your terminal after installing.

Common problems

  • "npm is not recognized": Node isn't installed or the terminal needs reopening.
  • Errors during npm install: paste the last 20 lines into your AI tool. Often it is a version mismatch; ask which Node version the project expects.
  • The AI wants to install a package you have never heard of: check it exists on the npm website, is widely used and recently updated. AI tools occasionally invent package names, and attackers sometimes publish packages with those names.

Read next: The terminal without fear: the commands you actually need and Environment variables and .env files: where secrets go.

More in Tools explained