---
title: "Let’s Debug a Node.js Application"
description: "Node.js debugging options range from structured logging to post-mortem analysis."
url: "https://swe.quest/articles/let-s-debug-a-node-js-application-f46c7c5e6bf92ab4"
canonical: "https://www.heroku.com/blog/debug-node-applications/"
source: "Heroku Engineering"
published: "2020-08-03"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["debugging","javascript","developer-tools"]
---

# Let’s Debug a Node.js Application

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2020-08-03, 4 min read, How-to. Original: [https://www.heroku.com/blog/debug-node-applications/](https://www.heroku.com/blog/debug-node-applications/)

## Summary

Node.js debugging options range from structured logging to post-mortem analysis. Use leveled loggers like Pino or Winston instead of console.log, set breakpoints and take heap snapshots via \`node --inspect-brk\` with Chrome DevTools, an IDE, or ndb (which supports edit-in-place), and analyze native crashes with llnode on core dumps produced by \`process.abort\`. The debug module filters namespaced log output through the DEBUG environment variable, while trace and clarify improve async stack traces locally but should not run in production.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Node.js basics ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- asynchronous JavaScript ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Node.js, Chrome DevTools, Node Inspect, ndb, llnode, Pino, Winston, debug

## Related posts

- [Remote Debugging with SSH and VS Code](https://swe.quest/articles/remote-debugging-with-ssh-and-vs-code-d3c247b65e523308.md): Render · 2022-02-23 · Medium · 7 min read · Debugging, JavaScript, Developer tools, Networking
  A Node.js process running on Render can be debugged from a local VS Code instance by starting it with \`node --inspect=9229\` and forwarding the debug port over an SSH tunnel (\`ssh -N -L 9229:localhost:9229\`).
- [The Debugger is Here](https://swe.quest/articles/the-debugger-is-here-13c8e56684fd9503.md): Zed · 2025-06-18 · Medium · 7 min read · Developer tools, Debugging, Rust
  Zed now ships a native debugger built on the Debug Adapter Protocol, with out-of-the-box support for Rust, C/C++, JavaScript, Go and Python.
- [Improving Firefox stability on Linux](https://swe.quest/articles/improving-firefox-stability-on-linux-d17615a93e9d8285.md): Mozilla Hacks · 2021-05-19 · Medium · 6 min read · Debugging, Linux, Observability, Open source, Rust
  Mozilla went from being able to symbolicate under 20% of Linux Firefox crash reports to over 99% by scraping debug information for distro-packaged Firefox builds and their dependencies (GTK, Mesa, fontconfig, SQLite, etc.) from Arch, Debian, Fedora, OpenSUSE and Ubuntu repositories.
- [Four Approaches to Debugging Server-side WebAssembly](https://swe.quest/articles/four-approaches-to-debugging-server-side-webassembly-70e30fb86ae05146.md): Shopify Engineering · 2022-09-07 · Medium · 8 min read · WebAssembly, Debugging, Developer tools, Rust
  Step-debugging server-side WebAssembly can be done four ways: compiling to a native target and using LLDB/GDB, running the Wasm under Wasmtime inside LLDB, using a Wasm-specific debugger like Wasminspect, or using browser DevTools via Chrome's DWARF extension or source maps.
- [How to get deep traces in your Node.js backend with OTel and Deno](https://swe.quest/articles/how-to-get-deep-traces-in-your-node-js-backend-with-otel-and-deno-e60be1ff8da59b5c.md): Deno · 2025-03-13 · Medium · 6 min read · Observability, JavaScript, Runtimes & VMs
  Running an unmodified Node.js Express server under Deno 2.2+ with the \`--unstable-otel\` flag yields OpenTelemetry traces and span-correlated logs with no code changes.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
