Your setup: VS Code, Node.js, and basic terminal commands
Install VS Code and Node.js, learn the handful of terminal commands that move you between folders, make the TaskKit project folder, and check that Node runs.
Install VS Code and Node.js, learn the handful of terminal commands that move you between folders, make the TaskKit project folder, and check that Node runs.
Tested with TypeScript 7.x · Node.js LTS
In the last lesson you pressed Run and the page did everything: it checked your code, ran it, and showed you the result. That is a good way to start and a bad way to keep going. Close the tab and your program is gone. You cannot save it next to your other files, open it tomorrow, or show it to anyone.
A carpenter does not build furniture in the shop's showroom. They
have a workbench, a few tools on the wall, and a place where the
work waits for them overnight. In this lesson you set up yours: VS
Code (Visual Studio Code) to write in, Node.js to run what you
write, and the terminal to give your computer orders by typing
them. By the end you will have a folder called taskkit that holds
the project you build through this whole level, open in VS Code,
with Node answering when you call it.
A program is a text file, so the first thing you need is somewhere good to write text. A code editor is a text editor built for code: it colours the parts of a line so you can read them at a glance, points at mistakes as you type, and keeps every file of a project in one window. This course uses VS Code, which is free and runs on macOS, Windows and Linux.
The second thing you need is something that runs the file. In the last lesson the page did that in the background. On your own computer it is Node.js, usually just called Node: a program whose whole job is to carry out JavaScript, the language TypeScript is built on, top to bottom.
The third thing is a way to tell Node to start. Node has no window and no button. You start it by typing its name in the terminal, a window where you type a command, press Enter (on a Mac the key says return), and read the answer.
Opens your project's files, colours the code and marks mistakes as you type
Takes one typed command at a time and starts the program it names, Node included
Carries out your program, line by line, and prints what it is told to print
You will spend most of your time in VS Code. The terminal is where you go for a few seconds at a time, to start Node and to move between folders, and in a few minutes you will have one inside VS Code too.
Both tools come from their official websites and install like any other app. Pick your system once, and every set of instructions in this course switches to it.
Install VS Code
Go to code.visualstudio.com and press Download for macOS. Open the downloaded file, then drag Visual Studio Code into your Applications folder.
Go to code.visualstudio.com and press Download for Windows. Run the installer and keep the option Add to PATH (requires shell restart) ticked: it lets you open VS Code from the terminal later in this lesson. (PATH is the list of folders the terminal searches for programs; the end of this lesson explains it.) If the installer shows a GitHub Copilot CLI page (CLI: command-line interface; Copilot is an AI helper this course does not use), choose Don't add the copilot command.
Go to code.visualstudio.com and
download the .deb package (Ubuntu, Debian) or the .rpm package
(Fedora). Open it to install it with your system's software app.
Install Node.js
Go to nodejs.org and choose the version marked LTS, short for Long Term Support. It is the one that gets fixes for years, and the one this course is tested with.
Download the macOS Installer (.pkg), open it, and press Continue, Agree and Install, type your Mac password when asked, and carry on until the last screen's Close button.
Download the Windows Installer (.msi), run it, and keep every option as it is.
The Linux download page shows a few commands to copy into a
terminal. Open one with Ctrl + Alt +
T and run them one by one, in order: they install a small
tool called nvm (Node Version Manager, which installs Node and
switches between its versions), and nvm installs Node. If the
terminal says curl (a small program that downloads files) is not
found, run sudo apt install curl first: apt is Ubuntu's
installer, and sudo runs it as the computer's administrator, which
is why it asks for your password. Then run the commands again.
A terminal waits for you at the prompt: a short line that ends
in %, $ or >, with a blinking cursor after it. Whatever you
type there is a command. Nothing happens while you type; the
terminal acts only when you press Enter. It then prints
its answer, if it has one, and shows the prompt again, ready for the
next command.
Ask Node which version you installed. Type this and press Enter:
Any version from v24 up is fine; yours may have higher numbers.
The --version part is a flag: an extra word that changes what a
command does. Without it, node would start running code. With it,
Node only says which version it is and stops.
Seeing a version number means five things just went right, in order. Press Next step to walk through them, or let it play.
You
Terminal
Node
All 5 steps shown.
The terminal takes the first word as a program's name, finds that program, starts it and passes it the rest of the line. Of those five steps, finding the program is the one that goes wrong most often, and you will see why at the end of this lesson.
Node came with a second tool, npm (its name comes from Node package manager), which installs code other people have written. You will use it later in this module. For now, check that it is there too:
Your number may differ; any number means npm is there.
On most Windows computers PowerShell refuses to run npm, with a
long message that includes running scripts is disabled on this system. PowerShell blocks script files until you allow them for
your own account. Run this once, answer Y, and open a new
terminal:
RemoteSigned allows scripts made on your own computer, like npm's,
and still blocks unsigned scripts downloaded from the internet.
Your computer keeps files in folders, and folders inside other
folders. Programmers often call a folder a directory; the two
words mean the same thing. A path is a folder's full address:
every folder you pass through to reach it, separated by slashes.
On a Mac, /Users/ana/projects is the projects folder inside
ana, inside Users. Windows starts a path with a drive letter
and uses backslashes, C:\Users\ana\projects, and Linux keeps
its home folders in home, /home/ana/projects. Each is the same
projects folder, written the way its own system writes it.
The terminal is always standing in exactly one folder, called the working directory. Think of a building with many rooms: you are always in one room, and when you say "open the drawer", you mean the drawer in the room you are standing in. Every command you type works on the folder you are standing in, unless you tell it otherwise. When a new terminal opens, you start in your home folder, the one named after your account.
Two commands tell you where you are and what is around you:
pwd, short for print working directory, and ls, short for
list.
The %, PS …> (PS for PowerShell) and $ at the start of a line
are the prompt, which you do not type. ana stands for your own
account name, and your list of folders will be different. On Windows,
type ls -Name: plain ls in PowerShell prints a table with dates
and sizes as well, and -Name asks for the names only. PowerShell
also prints pwd's answer under a small heading, Path.
To move, use cd, short for change directory, followed by the
name of a folder inside the one you are in. Two dots, .., always
mean "the folder that holds this one", so cd .. steps back out.
Here is a short walk, one command at a time. Press Next step to
take it yourself, or let it play:
All 4 steps shown.
All 4 steps shown.
All 4 steps shown.
You never "see" yourself move. The only proof is what pwd prints,
so ask it whenever you are unsure. It costs nothing and it answers
the question behind most terminal surprises: where am I?
Every lesson in this level adds a piece to TaskKit, a small task
manager you run from the terminal. It needs a home of its own. You
make a folder with mkdir, short for make directory, and the name
you want.
cd ~ goes home first, wherever you are: ~ is short for your home
folder. Then you make projects, a folder for everything you build,
move into it, make taskkit, the folder for this level's project,
move into that, and check with pwd where you ended up. Run these
lines one at a time, pressing Enter after each:
On a Mac and on Linux, mkdir prints nothing when it works, and that
is normal in the terminal: no news is good news. PowerShell prints a
small table naming the folder it made, which also means it worked. If
mkdir answers File exists (on Windows, already exists), the
folder is there from an earlier try. Skip that line and carry on with
the next cd.
Now open the folder in VS Code. The code command does that, and
the . after it means "the folder I am standing in":
The first time VS Code opens a folder, it asks whether you trust the authors of its files. You are the author, so choose Yes, I trust the authors. VS Code then shows TASKKIT in the panel on the left: an empty project, ready for its first file in the next lesson.
From here on you do not need the separate terminal app. Press these keys to open a terminal inside VS Code:
The second key is the backtick, `. If your keyboard has it
somewhere hard to reach, open the Terminal menu and choose
New Terminal instead.
It starts in your project folder, so pwd prints the path to
taskkit straight away.
You have asked Node for its version. Now ask it to do some work.
Type node on its own and press Enter. Node starts and
waits for you with a prompt of its own, a single >:
The block is not for copying. After the >, type 2 + 3 and press
Enter, then console., then .exit. The
welcome lines, the > and the answers are Node's.
This is Node's REPL, short for read, evaluate, print, loop: it
reads one line, works it out, prints the result, and waits for the
next. It is the same Node that will run your files, answering one
line at a time, which makes it a good place to try something small.
The undefined after TaskKit is Node telling you that
console.log showed some text and handed back no value of its own.
You will meet undefined properly in a later module.
To leave, type .exit and press Enter, or press these
keys twice:
The prompt that comes back is the terminal's again.
That switch is where people trip. While Node's > is showing,
everything you type is read as JavaScript, terminal commands
included.
Bad — a terminal command typed at Node's prompt, so Node tries to read it as code.
Node repeats the line and marks the word it could not read with ^.
Good — leave Node first, then the terminal gets the command.
Nothing breaks either way, but the first version can cost you ten
minutes of retyping a correct command at the wrong prompt. Before
you type, glance at the start of the line: a lone > is Node, and a
prompt ending in %, $ or PS …> is the terminal.
Moving through folders is a small program of its own: each command runs in order and starts where the last one left you. Read these lines, follow them in your head, and decide which folder the last one says you are in.
Predict
From your home folder, which folder are you in at the end?
Remember the second step after you press Enter: the terminal finds a program by its name. It looks in a list of folders called the PATH (in capitals, and not the same as a folder's path). On Windows and Linux, the installer adds Node's folder to that list, but a terminal reads the list once, when it opens, so one that was already open never hears about it. On a Mac, Node goes into a folder that is already on the list, so an open terminal finds it; there, the same message means the install did not finish.
If a fresh terminal still cannot find node, the install did not
finish. Run the installer again to its last screen (on Linux, the
download page's commands again), then open a new terminal.
Pass all four tasks to complete the lesson with practice. Reach the end without them and it counts as read only.
These run in your browser, so they ask about the terminal rather than open one. Use your own terminal to try any of them for real.
Recap · 3 questions
Check yourself
What does the terminal do when you press Enter?
Check yourself
You are in ~/projects. Where does cd .. take you?
Check yourself
On Windows, the terminal cannot find Node. Why?
0 of 0 answered.
Cheat sheet
Your setup: VS Code, Node.js, and the terminal
What things are
| Word | What it means |
|---|---|
| VS Code | The code editor where you write and read files |
| Terminal | A window that runs typed commands |
| Node | The program that runs your code |
| npm | Node's tool for adding code other people wrote |
| Prompt | Where the terminal waits for your next command |
| Working directory | The folder the terminal is standing in |
| Path | An address: /Users/ana, C:\Users\ana, /home/ana |
| PATH | Where the terminal looks for programs, read at start |
Moving around
| Write | To |
|---|---|
pwd | Print the folder you are in |
ls | List what is in this folder; ls -Name on Windows |
cd projects | Move into a folder inside this one |
cd .. | Move out to the folder that holds this one |
cd ~ | Go to your home folder |
mkdir taskkit | Make a new folder here |
Tools
| Write | To |
|---|---|
node --version | Check that Node is installed |
npm --version | Check that npm came with it |
node | Start Node's own prompt, the REPL |
You now have a workbench: VS Code to write in, Node to run your
code, and a terminal you can steer with pwd, ls, cd and
mkdir. You also know the two questions that solve most terminal
trouble: where am I, and who is reading what I type?
Next is Hello, world: running your first .ts file (and the online
Playground), where you create the first file in taskkit, write a
line of TypeScript in VS Code, and run it with Node from the terminal
you just set up.
Before you move on, close everything and do it once more from
memory: open a terminal, go to taskkit, check with pwd, open it
with code ., and ask Node its version from the terminal inside
VS Code. Doing it twice is what turns a list of steps into a habit.
Open a new terminal
Open the terminal app that came with your system. If one was open during the install, close it and open a fresh one: on Windows and Linux, a terminal learns where to find programs only when it starts.
Press ⌘ Cmd + Space, type Terminal, and
press return.
Open the Start menu, type Terminal, and press
Enter. It opens PowerShell, which understands every
command in this lesson.
Press Ctrl + Alt + T, or find Terminal among your apps.
.exit |
| Leave Node's prompt |
code . | Open this folder in VS Code |
Ctrl + ` | Open a terminal in VS Code; Control on a Mac |
Ctrl + C twice | Leave Node's prompt; Control on a Mac |
const title = "TaskKit";
console.log(titel);Cannot find name 'titel'. Did you mean 'title'?
Opens your project's files, colours the code and marks mistakes as you type
Takes one typed command at a time and starts the program it names, Node included
Carries out your program, line by line, and prints what it is told to print
const title = "TaskKit";
console.log(titel);Cannot find name 'titel'. Did you mean 'title'?
Opens your project's files, colours the code and marks mistakes as you type
Takes one typed command at a time and starts the program it names, Node included
Carries out your program, line by line, and prints what it is told to print
On macOS, VS Code does not add the code command by itself. Open VS
Code from Applications, press ⌘ Cmd + ⇧
Shift + P, type shell command, and choose Shell
Command: Install 'code' and optionally 'copilot' commands in PATH
(on some computers it is called Shell Command: Install 'code'
command in PATH). If it asks whether to install GitHub Copilot CLI
too (CLI: command-line interface; Copilot is an AI helper this
course does not use), choose No. Then open a new terminal, go
back to the folder with cd ~/projects/taskkit, and run code .
again.
The installer adds the code command only while its option Add
to PATH stays ticked. Run the installer again, keep that option
ticked, and finish it. Then open a new terminal, go back to the
folder with cd ~/projects/taskkit, and run code . again.
The .deb and .rpm packages add the code command as they
install. If it is missing, the install did not finish: open the
package again with your system's software app and install it to
the end. Then open a new terminal, go back to the folder with
cd ~/projects/taskkit, and run code . again.
Common mistake
Running node before the installer finished
You started the Node installer, went back to the terminal before its last screen, and typed:
node --versionNode is not installed yet: the installer stopped halfway.
zsh: command not found: node
The fix
Open the installer again and press Continue, Agree and Install, type your Mac password when asked, and carry on until the last screen's Close button. Then open a new terminal and run the command once more:
node --versionCommon mistake
Running node in a terminal opened before the install
You opened a terminal to follow the instructions, installed Node in another window, came back, and typed:
node --versionNode is installed. This terminal just never heard about it.
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program.
The fix
Close the terminal and open a new one. If you are using the terminal inside VS Code, quit VS Code completely and start it again, because its terminals copy the list from VS Code when it starts. Then run the command once more:
Common mistake
Running node in a terminal opened before the install
You opened a terminal to follow the instructions, installed Node in another window, came back, and typed:
Node is installed. This terminal just never heard about it. Do not
run the apt install nodejs line Ubuntu suggests under the message:
it installs an old Node, not the LTS this course uses.
Command 'node' not found, but can be installed with:
The fix
Close the terminal and open a new one. If you are using the terminal inside VS Code, quit VS Code completely and start it again, because its terminals copy the list from VS Code when it starts. Then run the command once more:
A folder that is not here
You are in your home folder, and taskkit is inside projects. You
type cd taskkit and press Enter. What happens?
Get into the project
You are in projects, and ls prints taskkit. Which command
puts you inside the TaskKit folder?
Which prompt is this
Your terminal shows this, with the cursor after the >. You want
to list the files in the folder. What do you do?
Welcome to Node.js v24.11.1.
Type ".help" for more information.
>node --versionv24.11.111.6.2Welcome to Node.js v24.11.1.
Type ".help" for more information.
> 2 + 3
5
> console.log("TaskKit")
TaskKit
undefined
> .exit> cd taskkit
cd taskkit
^^^^^^^
Uncaught SyntaxError: Unexpected identifier 'taskkit'npm --versioncd ~
mkdir projects
cd projects
mkdir taskkit
cd taskkit
pwdcode .cd projects
cd taskkit
cd ..
pwd% pwd
/Users/ana
% ls
Desktop Documents DownloadsPS C:\Users\ana> pwd
Path
----
C:\Users\ana
PS C:\Users\ana> ls -Name
Desktop
Documents
Downloads$ pwd
/home/ana
$ ls
Desktop Documents Downloads/Users/ana/projects/taskkitPath
----
C:\Users\ana\projects\taskkit/home/ana/projects/taskkit> .exit
ana@mac projects % cd taskkit> .exit
PS C:\Users\ana\projects> cd taskkit> .exit
ana@laptop:~/projects$ cd taskkitSet-ExecutionPolicy -Scope CurrentUser RemoteSignedconst title = "TaskKit";
console.log(titel);Cannot find name 'titel'. Did you mean 'title'?
Put the setup in order
This program prints the commands that make the TaskKit folder and open
it, but in an order that would fail: it moves into taskkit before
the folder exists, and opens VS Code in the wrong place. Change the
order of the lines, without changing any line itself, so the commands
would work from top to bottom, starting in your home folder.
Loading the editor…
node --versionnode --versionnode --version