---
title: "Let’s Debug a Node.js Application"
description: "Node.js applications can be difficult to debug because asynchronous workflows complicate stack traces, while crashes may require core-dump analysis through complex command-line tools. The article presents a layered toolkit: production-oriented logging with Pino or Winston, interactive inspection through Node Inspect and Chrome DevTools, IDE integrations, and the standalone ndb debugger. Running node --inspect-brk launches an application for inspection at chrome://inspect, where breakpoints, stepping, call stacks, heap snapshots, and memory profiling are available; ndb additionally supports edit-in-place changes. For catastrophic crashes, llnode maps JavaScript frames and objects to C/C++ representations from a core dump generated with process.abort, while debug filters namespaced logs and trace and clarify improve asynchronous traces and remove Node.js internals, respectively, for local debugging."
---

# Let’s Debug a Node.js Application

[Heroku](https://yomu.fyi/company/heroku) · Julián Duque · Aug 3, 2020

**Type:** Tutorial

## Summary

Node.js applications can be difficult to debug because asynchronous workflows complicate stack traces, while crashes may require core-dump analysis through complex command-line tools. The article presents a layered toolkit: production-oriented logging with Pino or Winston, interactive inspection through Node Inspect and Chrome DevTools, IDE integrations, and the standalone ndb debugger. Running node --inspect-brk launches an application for inspection at chrome://inspect, where breakpoints, stepping, call stacks, heap snapshots, and memory profiling are available; ndb additionally supports edit-in-place changes. For catastrophic crashes, llnode maps JavaScript frames and objects to C/C++ representations from a core dump generated with process.abort, while debug filters namespaced logs and trace and clarify improve asynchronous traces and remove Node.js internals, respectively, for local debugging.

## Context

Node.js debugging is complicated by asynchronous workflows, limited visibility into asynchronous stack traces, and the need for complex command-line tooling to analyze core dumps after application crashes.

## Approach / What changed

The article describes logging with Pino or Winston, interactive debugging through Node Inspect, Chrome DevTools, supported IDEs, and ndb, post-mortem analysis with llnode and core dumps, and focused diagnostics using debug, trace, and clarify.

## Takeaways

- The debug module assigns namespaces to log messages and uses the DEBUG environment variable to selectively display messages, such as express:router output.
- trace adds detail about asynchronous methods to stack traces, while clarify removes Node.js-internal frames; neither module is recommended for production use.
- llnode inspects JavaScript stack frames and objects after a crash by mapping them to C/C++-side objects, using a core dump generated with process.abort.

**Tags:** [Debugging](https://yomu.fyi/topic/debugging), [Node.js](https://yomu.fyi/topic/node-js)

- Source: [Heroku](https://www.heroku.com/blog/debug-node-applications)
- Source URL: https://www.heroku.com/blog/debug-node-applications
- Ingested by Yomu: 2026-09-09T20:01:54.036Z

[Read original post](https://www.heroku.com/blog/debug-node-applications)
