← Level 3 – Master

Lesson 2 of 10 ⏱ 30 minutes Premium

The terminal and Node.js

You'll open the black window from hacker movies and discover it's a friend. And install Node.js.

What the terminal is

The terminal is a window where you type commands to the computer as text instead of clicking with a mouse. It looks scary, but it’s just another way of controlling things, and for programmers, it’s the main one. Don’t worry: you’ll need about five commands.

⚠️

Do the installation with a parent, just like with the editor back in the Prep level. And only run commands in the terminal that you understand (or that come from here). Random commands from the internet can wreck your computer.

How to open the terminal

Try it out

Type a command and press Enter:

echo Hi terminal

The terminal replies “Hi terminal.” That’s exactly how it works: you type a command → Enter → the computer responds. Two more useful ones:

pwd     # where am I right now? (prints the folder)
ls      # what's in this folder? (on Windows, "dir" also works)

What Node.js is and why you need it

So far, JavaScript has only run in the browser. Node.js lets it run anywhere, like on a server. And most importantly: Node.js comes with npm, a department store of ready-made pieces of code (packages), which we’ll use in a moment to download React and Vite.

Installation

  1. Go to nodejs.org and download the version marked LTS (Long Term Support = supported long-term, the most stable one).

  2. Run the downloaded file and click through the installer (Next → Next → Install). Don’t change anything, the default settings are correct.

  3. Close and reopen the terminal (important!) and check the installation:

    node --version
    npm --version

    When two version numbers show up (like v22.11.0 and 10.9.0), you’re done.

💡

“Command not found”? Usually just closing and reopening the terminal (or all of VS Code) fixes it. If that doesn’t help either, restart your computer: the installer needs the system to “notice” the new program.

Your command cheat sheet

These four commands cover 90% of your work. Save them:

CommandWhat it does
cd folder-namego into a folder (cd .. = go back one folder)
ls (or dir)show what’s in the folder
npm installdownload the packages a project needs
npm run devstart the development server (stop it with Ctrl+C)
✅

Check yourself: node --version and npm --version both print numbers, and you can use the terminal to move into a folder (cd) and list its contents (ls). The pro’s workshop is ready, in the next lesson, we’ll set up your first React app.

What to take away from this lesson