Installing Your Tools

Set up everything you need — Node.js, a code editor, and your first 'Hello World' from the terminal.

Playwright Automation Prep Lesson 2
12 min read

What you'll learn

  • Install Node.js and verify it works
  • Install VS Code and understand what it does
  • Run your first JavaScript from the terminal
  • Understand what Node.js is and why we need it

Installing Your Tools

Time to set up our workbench. Two tools to install: Node.js (runs our code) and VS Code (where we write it).

The Stack You’re Building

Before we install anything, here’s the shape of what you’ll end up with. Each layer sits on top of the one before it:

Your Computer

Node.js

runs JS everywhere

npm

installs packages

Your Project

your test code

What is Node.js?

What is npm?

Installing Node.js

  1. 1

    Download from nodejs.org

    Open nodejs.org and click the LTS button. LTS = Long Term Support = stable, well-tested, recommended.

  2. 2

    Run the installer

    Mac: open the .pkg file. Windows: open the .msi file. Click Next / Continue through everything. Leave defaults as-is.

  3. 3

    Verify it works

    Open a terminal and check. You should see a version number.

    node --version
Verify Node.js is installed
$ node --versionv20.11.0$ npm --version10.2.4# Two version numbers = you are good to go!

Try it in your terminal!

Quick check

Question 1 of 10 correct

Which version of Node.js should you download?

What is a Code Editor?

We’ll use VS Code — free, from Microsoft, loved by millions.

Notepad

Please don't.

const name = "world";
function greet(who) {
  console.log("Hello, " + who);
}
greet(name);

VS Code

This one.

const name = "world";
function greet(who) {
  console.log("Hello, " + who);
}
greet(name);

Installing VS Code

  1. 1

    Download

    Go to code.visualstudio.com and click the big download button.

  2. 2

    Install

    Mac: drag VS Code into Applications. Windows: run the installer, check 'Add to PATH' if you see it.

  3. 3

    Open a folder

    File → Open Folder. Always open your project's root folder — not individual files.

  4. 4

    Open the built-in terminal

    View → Terminal. Or press Ctrl + ` (backtick, above Tab).

Your First JavaScript

Method 1: Interactive mode (REPL)

Play with Node directly
$ nodeWelcome to Node.js v20.11.0.Type ".help" for more information.$ console.log("Hello, QA World!")Hello, QA World!$ 2 + 24$ "Hello" + " " + "World"'Hello World'# Exit with .exit or press Ctrl + C twice

Try it in your terminal!

Method 2: Run a file

  1. 1

    Navigate somewhere

    cd ~/Desktop
  2. 2

    Create a file

    Windows: New-Item hello.js

    touch hello.js
  3. 3

    Open it in VS Code

    code hello.js
  4. 4

    Write some code

    Put a few console.log lines in the file. Save with Cmd+S / Ctrl+S.

  5. 5

    Run it

    node hello.js
Running hello.js
$ node hello.jsHello from a file!My name is Alex and I'm learning QA.Today I installed Node.js and VS Code!

Try it in your terminal!

That’s the real-world workflow: write code in a file, run it with Node.

Quick check

Question 1 of 10 correct

You saved a file called app.js. How do you run it?

What We Just Installed

ToolWhat it isWhy we need it
Node.jsRuns JavaScript on your computerOur testing tools are built on it
npmPackage manager (comes with Node)Lets us install testing tools
VS CodeCode editorWhere we write our tests

Practice Exercises

To check if Node.js is installed, type in the terminal

Check Your Understanding

Question 1 of 30 correct

What is Node.js?