Open the Terminal and Check Node

In the last lesson, you made a course folder called js-course with a scratch folder inside it, and you opened js-course in VS Code. That folder is where your programs will live. To run them, you need two more tools: the terminal and Node.

In this lesson, you’ll check that Node is installed, run a small file you’ll create to prove your setup works, and learn to identify which folder your terminal is in. You’ll also meet the most common first error and see that it’s a quick fix, not a broken computer.

Open the Terminal Inside VS Code

The terminal is a window where you type commands to your computer instead of clicking on things. You type one line, press Enter, and the computer answers with text in the same window. VS Code has a terminal built in, called the integrated terminal, so your code and the place where you run it sit side by side.

Start with your course folder open in VS Code. If it isn’t, then choose File → Open Folder, pick js-course, and confirm. The Explorer panel on the left should show JS-COURSE at the top with scratch inside it.

Now choose Terminal → New Terminal. A panel opens at the bottom with a short line of text and a blinking cursor. That line is the prompt, the terminal’s way of saying it’s ready for your next command.

The prompt looks different on each computer, and on most of them it includes the folder the terminal is working in. Here are common examples for someone named Maya on Windows, macOS, and Linux:

Language: Text
PS C:\Users\maya\Documents\js-course>
maya@Mayas-MacBook js-course %
maya@laptop:~/Documents/js-course$

In each example, the end of the prompt, just before the >, %, or $, says js-course. That’s the folder the terminal is in, and every command you type runs from there. VS Code started the terminal in js-course because that’s the folder it has open.

Some prompts don’t show the folder at all. If yours doesn’t, a terminal you open with Terminal → New Terminal still starts in the folder at the top of the Explorer, JS-COURSE.

Check That Node Is Installed

Your programs in this course run directly on your computer rather than in a web browser. The program that makes this possible is Node.js, or Node for short. You give Node a JavaScript file, and Node runs it and shows the result in the terminal.

To check that Node is installed, click in the terminal, type node -v, and press Enter. The -v is short for version:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.