Node.js 24 cheatsheet

Node.js 24: Debugging

4 common Node.js 24 tasks.

Start the debugger

Run with the inspector open, then attach from Chrome DevTools (chrome://inspect) or your editor.

node --inspect app.js

Pause on the first line

Start the inspector and wait at the first line until a debugger attaches.

node --inspect-brk app.js

Show where warnings come from

Print a stack trace for process warnings such as deprecations.

node --trace-warnings app.js

Raise the memory limit

Set the maximum size of the old generation heap in MiB.

node --max-old-space-size=4096 app.js

Was this page helpful?