Skip to content
zero2vibecodelearn vibe coding
Level 4 · Tools and version control 5 min Reviewed by the author · Aug 4, 2026

What node and npm actually are

Node runs JavaScript files outside a browser. npm fetches code other people wrote. Almost every "run this to set up the project" instruction is one of those two.

Level 4 · 0 / 4 lessons0%

Two names you will meet in the first five minutes of any project’s README. They are much simpler than they sound.

node — runs JavaScript files

JavaScript started as a language for web pages, running inside a browser. Node.js is a program that runs JavaScript outside a browser — as an ordinary command-line program.

node app.js

That reads app.js, runs it, and prints whatever it prints. If the file contains:

console.log('Hello from Node')

then you see:

Hello from Node

That is the whole relationship. node is the engine; your .js file is the instructions.

Note

console.log(...) is JavaScript’s way of printing a line, the same idea as echo in the . When you run a JS file from the terminal, that is where its output shows up.

Quick check

What is Node.js, in one line?

npm — fetches other people's code

Almost nobody writes a project entirely from scratch. You use libraries: a date handler, a web framework, a test runner.

npm (Node Package Manager) is the tool that downloads them. It comes bundled with Node, so installing one gives you both.

npm install

That reads the project’s list of required packages and fetches every one of them. This is the command behind most “just run this to set up the project” instructions.

Quick check

A README says to run `npm install` before anything else. What is that doing?

Checking whether they are there

node -v
npm -v

Each prints a version number. A version means the tool is installed and the shell can find it.

If instead you get:

node: command not found

that is not a typo — it means Node is not installed on this machine, or it is installed somewhere the shell does not look. Either way, the fix is installation, not retyping.

Tip

command not found always means the same thing, for any command: the shell searched its list of program folders and came up empty. It is a “not installed” message, not a “you spelled it wrong” message.

Quick check

You run `npm -v` and get `npm: command not found`. What is the problem?

Try it

Note

Fair warning: this simulator does not really run JavaScript. It reads your file, finds the console.log lines, and prints what they would print. Enough to learn the workflow, not a real Node install.

  1. node -v — a version number comes back, so Node is available.
  2. ls — see app.js sitting in the folder.
  3. node app.js — run it and read the output.

Three commands, and you have run a program from the terminal.

Check your understanding

Answered 0/3
Mode:

What does `node app.js` do?

What is npm for?

Why is `node -v` a good first thing to run on a new machine?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Check that Node is installed, then run a JavaScript file with it.

Tab complete · history · Ctrl+L clear · help commands

  • Not done: Check the Node version
  • Not done: Run app.js with node
  • Not done: The script printed its line

Lesson Q&A

What does `node app.js` do?

node is the program that executes JavaScript files outside a browser.

What is npm for?

npm is the package manager. node runs your code; npm fetches everyone else's.

Why is `node -v` a good first thing to run on a new machine?

A version number means it is installed and on your PATH. "command not found" means it is not.

What is Node.js, in one line?

Browser JavaScript needs a browser. Node lets the same language run as a normal command-line program.

A README says to run `npm install` before anything else. What is that doing?

The project lists what it needs; npm install goes and gets it. Nothing runs yet.

You run `npm -v` and get `npm: command not found`. What is the problem?

command not found is about the program's existence, not about the folder you are standing in.

Move between lessons with · search with ⌘K