CalcSnippets Search
Node.js 1 min read

`node --inspect` Is the Command You Reach For When `console.log` Has Stopped Being Enough and You Need a Real Debugger Attached to the Process

A practical guide to `node --inspect` for starting a Node.js process with debugging enabled so breakpoints and runtime inspection can replace blind logging.

Why this command matters: there is a point where more console.log output stops being debugging and starts being denial.

When you need breakpoints, stack inspection, variable state, or step-through execution in a Node.js process, node --inspect is the command that opens the real debugger path.

The command

node --inspect app.js

For a process that should break immediately:

node --inspect-brk app.js

That second form is especially useful when the bug happens during startup and you cannot attach quickly enough after launch.

Why it helps

It is useful when:

  1. startup logic fails before logs become meaningful
  2. async state is too hard to reason about from prints
  3. values differ from what your logging made you think
  4. you need to inspect the call path interactively

This is where proper debugging earns its keep.

Final recommendation

If a Node process needs real inspection instead of another logging spree, start it with node --inspect or --inspect-brk. It is still one of the fastest ways to graduate from guess-heavy debugging to actual runtime visibility.

Sources

Keep reading

Related guides