Course
BASICModule 4: Code on Your Machine· 1/2

Terminal & Runtimes

From the playground to your own computer

The course playgrounds are convenient for learning, but real programs live as files on disk and run in the terminal. This step is the border between "played with code" and "wrote a tool": a file on disk runs on a schedule, processes your documents, goes online.

If you took the Claude Code module in the AI course, the terminal is already familiar — Claude Code lives there too. Programs run exactly the same way.

Three terminal commands

The minimum is enough to run programs (Windows — PowerShell from the Start menu, Mac — Terminal):

  • cd path — go into a folder: cd Desktop\scripts
  • dir (Windows) / ls (Mac) — show the folder's contents
  • node file.js / python file.py — run a program

That's it. The rest of the commands come with practice — or Claude suggests them.

Runtimes

Code is text; for it to run, you need a runtime:

  • Node.js for JavaScript — nodejs.org, the LTS button. If you installed Claude Code, Node.js is already there.
  • Pythonpython.org. On Windows, check the "Add Python to PATH" box during install — without it the terminal won't find the python command.

Check after installing — in the terminal:

node --version     → v22.x.x
python --version   → Python 3.12.x

A version came back — the runtime is ready.

The first file

  1. Create a folder for experiments, for example Desktop\code.
  2. Create a file hello.js (or hello.py) in it — any text editor works; the right choice for code is the free VS Code.
  3. Put code inside — for example, the converter from module 2.
  4. Terminal: cd Desktop\code, then node hello.js or python hello.py.

The output that appeared in the result window of the playground appears right in the terminal. It's the same program — it just lives with you now and runs without a website.

Feeding in data: arguments

A program in a file can take data at launch — command-line arguments:

PLAYGROUND

Remember the type trap from module 1? Arguments always arrive as strings — Number() / float() before arithmetic is mandatory.

Key takeaways

  • Real programs are files on disk, run from the terminal.
  • Three commands: cd, dir/ls, node/python + a file name.
  • Runtimes: Node.js for JS, Python with the "Add to PATH" box; check with --version.
  • Command-line arguments arrive as strings — convert the types.
CHECK YOURSELF
1. The terminal answered "python is not a command" after installing Python on Windows. The classic cause?
2. How do you run the file script.js from the terminal’s current folder?
JSONErrors & Debugging