0.2 · Install Node.js, npm & set up VS Code

Getting started

0.2Install Node.js, npm & set up VS Code

Goal: Have a working Node workstation: verified Node LTS + npm, VS Code configured with integrated terminal and extensions.
Estimated time: 9 min · self-paced reading · If you only have 5 min: read “The essentials in 30s” + the diagram.

The essentials in 30 seconds

  • Installing Node brings Node + npm together: the executable that runs your scripts and the package manager.
  • Pick the current LTS: a stable version maintained for a long time, compatible with the ecosystem — not the unstable Current.
  • Verify then equip: version commands in the terminal, then VS Code with integrated terminal and extensions.

Running mini-case — Salim sets up his workstation in Algiers

Salim, a junior developer in Algiers, receives his first workstation: a blank laptop. He installs the current LTS of Node (with npm included), checks in the terminal that both version commands answer, installs VS Code, opens his folder there and spots the integrated terminal. He adds two extensions for quality and formatting. By the end of the day, his "workstation ready" card is checked: Node LTS, npm, VS Code, working terminal — he can code under real conditions.

Self-contained case for this section: it returns in the lesson, diagram, script and 48h challenge of section 0.2.

1. Node + npm, in the current LTS version

Installing Node brings two tools: Node (the executable that runs your scripts) and npm (the package manager, installed automatically). Pick the current LTS (Long Term Support): stable and maintained for a long time, it is the one for production and learning. The Current version is newer but less stable, reserved for testing new features. Two ways to install: the official installer (simple, perfect to start) or a version manager like nvm (several versions side by side, useful when projects require different versions). Salim picked the official installer to get started.

2. Verify in the terminal

After installing, verify in the terminal: the Node and npm version commands must display numbers — proof that Node is in the PATH. If they do not answer, it is the installation or the PATH you must fix before coding, not the code itself. Salim types both commands in Algiers, sees two numbers appear, and knows his execution chain is in place. The terminal is not optional in Node: this is where you run node and npm every day.

3. Configure VS Code like a pro

For the editor, VS Code is the standard: free, built-in JavaScript support, integrated terminal, extensions (ESLint for quality, Prettier for formatting). Salim opens his project folder there, opens the integrated terminal in the same window, and adds both extensions. The Node LTS + npm + VS Code trio is the Node developer workstation: well tuned from the start, it avoids the friction of the first weeks.

Common misinterpretation: "Newest is always best, let's take Current, and the terminal can be skipped". No. To learn and ship, the current LTS brings stability, npm compatibility and long support; Current exposes you to instabilities with no benefit for a beginner. And the terminal is unavoidable in Node: running a script, installing a package, checking a version — everything goes through it. VS Code softens this with its integrated terminal, but you still have to learn the few basic commands.
The Node workstation Node LTS + npm + VS Code: verify before coding. Node (current LTS)Runs your scripts+npmPackage manager+VS CodeEditor + integrated terminal Prefer the current LTS: stable, compatible, maintained for a long time.
Node LTS + npm + VS Code: verify before coding.
Text version of the diagram (SEO / screen readers / translation): 1) Salim, a junior developer in Algiers, installs the current LTS of Node: he gets Node to run and npm for packages. 2) He checks in the terminal that both version commands answer, proof that Node is in the PATH. 3) He sets up VS Code with integrated terminal, ESLint and Prettier. Lesson: verified LTS + equipped VS Code = the standard Node developer workstation.

🔎 Concrete example — 🔎 Concrete example — Check the installation

node --version
npm --version
node -e "console.log('Poste OK : ' + process.version)"

Reading: Salim sees two numbers then "Workstation OK": Node answers and runs JS.

Lesson: if a command does not answer, fix the installation or the PATH before any code.

Section vocabulary

Node + npm
Installing Node brings the Node executable (which runs your scripts) and npm (the package manager), installed together.

Simple example: Salim installs Node and gets npm with no extra step.

What it is not: two unrelated programs to install separately.

Reflex: after any install, check both version commands.

LTS vs Current
Current LTS: stable and maintained for a long time, to prefer; Current: newer but less stable, for testing new features.

Simple example: Salim picks the current LTS to learn and ship with peace of mind.

What it is not: an end-of-life version with no security fixes.

Reflex: take the current LTS unless you have a specific reason to do otherwise.

nvm (Node Version Manager)
Tool that installs several Node versions side by side and lets you switch from one to another.

Simple example: Later, Salim will use nvm when two projects require two different versions.

What it is not: the official installer which only handles one version at a time.

Reflex: switch to nvm as soon as you juggle projects.

Terminal / PATH
Console where you run node and npm; if the version commands answer, Node is correctly in the PATH.

Simple example: Salim checks his PATH by seeing both numbers appear in Algiers.

What it is not: the editor alone, with no console.

Reflex: when facing an unknown command, check the PATH before blaming the code.

VS Code
Standard editor for Node and JavaScript: free, built-in JS support, integrated terminal, quality and formatting extensions.

Simple example: Salim edits on one side and runs node on the other, without leaving VS Code.

What it is not: a plain notepad with no terminal or extensions.

Reflex: work with folder open + integrated terminal + ESLint and Prettier.

In practice — In practice — Install and configure your Node workstation

  1. Install Node in the current LTS version (official installer, or nvm if you want to manage several versions).
  2. Check in the terminal: the Node and npm version commands must display numbers.
  3. Install VS Code, open a project folder there and locate the integrated terminal.
  4. Add the useful extensions (ESLint for quality, Prettier for automatic formatting).
You have a working Node workstation: verified Node LTS + npm, VS Code configured with integrated terminal and extensions — real developer conditions.

Ready-to-say script — announce your workstation is ready (30 s)

"Workstation ready: I installed the current LTS, Node and npm answer in the terminal, VS Code is configured with the integrated terminal, ESLint and Prettier. I can run our scripts exactly like in production."

Say it while showing both version numbers displayed in the integrated terminal.

Copy-paste template — check your workstation in JS

console.log("Node : " + process.version);
console.log("Dossier : " + __dirname);
console.log("Arguments : " + JSON.stringify(process.argv.slice(2)));
console.log("Poste de Salim : OK");

Windows workstation

On Windows: after the official installer, reopen the terminal then check both versions; use the VS Code integrated terminal to stay in the project folder.

macOS / Linux workstation

With nvm: install the current LTS, switch to it by default, then check both versions before opening VS Code.

Shared room in Algiers

Salim writes the installed LTS on the shared workstation card in Algiers: everyone checks the versions on arrival, without reinstalling blindly.

PATH recovery

Command not found: reinstall via the official installer (PATH box checked) or reload your nvm shell, then recheck before touching the code.

Caution: Always install the current LTS to learn and ship: stable, compatible with the npm ecosystem and maintained for a long time. Avoid the Current version (less stable) and end-of-life versions (no more security fixes): before coding, check that the version commands answer and migrate before your LTS reaches end of life.

✓ Best practices

  • Install the current LTS (stable, compatible with the npm ecosystem).
  • Check both version commands before coding.
  • Use the VS Code integrated terminal + ESLint and Prettier.

✗ Common pitfalls

  • Picking an unstable Current version to learn.
  • Keeping an end-of-life LTS with no security fixes.
  • Avoiding the terminal although it is unavoidable in Node.

Key takeaways

  • Installing Node brings Node (runs your scripts) AND npm (package manager) together; prefer the current LTS.
  • Check the install in the terminal: both version commands must answer (Node in the PATH).
  • nvm lets you install and switch between several versions — precious in pro work; the official installer is enough to start.
  • VS Code = standard editor (JS support, integrated terminal, ESLint and Prettier): the Node workstation trio.

48h challenge — apply tomorrow

Install the current LTS, display both versions in the VS Code integrated terminal, and run Salim's JS check template.

Section exit checklist
  • My workstation shows both versions (Node LTS + npm).
  • I opened a folder in VS Code with the integrated terminal.
  • ESLint and Prettier are installed and the JS template runs.
Self-rating 1-5: do I check versions before coding?Self-rating 1-5: did I pick the current LTS rather than Current?

Frequently asked questions

Why choose the LTS version rather than the latest available version?

The current LTS (Long Term Support) is stable, proven and maintained for a long time: security fixes without breaking changes, npm packages tested on it, alignment with companies and tutorials. Current holds the new features but is less stable and maintained for less time — for early preview testing, not for learning or shipping. Take the current LTS, and think about migrating before its end of life (no more fixes after). "Newest" is not always "best": stability and support come first.

Should you learn to use the terminal, or can you do everything in VS Code?

You must learn the terminal: running a script, installing a package, checking a version — all of that goes through the command line, with no all-click alternative, and it is the professional norm (Git, deployment, often headless servers). Good news: a few commands are enough to start (move around, list, run node and npm, check versions). VS Code softens this with its integrated terminal opened in the project folder: you edit on one side, you run on the other. Within days, it feels natural.

Check your understanding

Which Node version should you prefer to learn and ship?

Additional resources (optional, to go further)

Level 0 examFresh, harder questions to test what you've learned