Introduction

Completed

Edsger Dijkstra once said:

"If debugging is the process of removing bugs, then programming must be the process of putting them in."

As a developer at the enormous online retailer called Tailwind Traders, you're going to be writing many Node.js bugs, and that's okay because it's just part of coding.

In this module, you'll learn how to effectively debug Node.js programs. The faster you can find and identify bugs, the faster you can get your code to a working state. You'll spend less time scratching your head wondering why your code worked five seconds ago, but doesn't work now.

Learning objectives

By the end of this module, you'll be able to:

  • Use a dev container for your development environment
  • Use the Visual Studio Code debugger with a Node.js program.
  • Create breakpoints and run your code step by step to find issues.
  • Inspect your program state at any execution step.
  • Rewind the call stack to find the source of an exception.

Ultimately, you'll be able to find bugs effectively in your Node.js programs, and you won't need to rely only on console.log anymore.

Prerequisites

A development environment using one of the following:

  • A browser-based environment which relies on a GitHub account and Codespaces.
  • A local computer setup with Visual Studio Code and Docker (Community edition) installed.