node-inspect-debugger

Debug Node.js processes via the V8 inspector and Chrome DevTools Protocol.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill node-inspect-debugger-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: node-inspect-debugger
Source: https://github.com/CHENHUI-X/toolbox/tree/main/official-skills/software-development/node-inspect-debugger
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill node-inspect-debugger-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires chrome-remote-interface.

What problem does it solve? When console.log is not enough, this Skill lets you drive Node's built-in V8 inspector from the terminal to set real breakpoints, step through code, walk call stacks, dump local and closure scopes, and evaluate arbitrary expressions in paused frames. ## Core Features & Use Cases - Interactive REPL debugging: Use node inspect to set breakpoints, step in/over/out, watch expressions, and drop into a scoped REPL with zero installation. - Programmatic CDP automation: Script breakpoint management, scope capture, CPU profiles, and heap snapshots via chrome-remote-interface for non-interactive debugging. - Attach to running processes: Enable the inspector on live Node processes with SIGUSR1 and attach by PID or WebSocket URL, including Ink-based TUI apps and Vitest test runs. - Use Case: A Vitest test fails in a TypeScript project. Launch it with node --inspect-brk, attach the debugger, set a breakpoint in the suspect file, and inspect closure state that console.log cannot reach. ## Quick Start Ask the agent to launch your Node script with --inspect-brk, attach node inspect, set a breakpoint at the failing line, and print the local variables when it pauses.

Frequently Asked Questions about node-inspect-debugger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a Node.js script from the command line?

Run node inspect path/to/script.js to launch the built-in debugger paused on the first line. Use sb() to set breakpoints, c to continue, n to step over, and repl to evaluate expressions in the current scope.

How do I attach a debugger to a running Node process?

Send SIGUSR1 to the process with kill -SIGUSR1 <pid>, which starts the inspector on port 9229. Then attach with node inspect -p <pid> or use the WebSocket URL from http://127.0.0.1:9229/json/list.

What is the difference between --inspect and --inspect-brk?

--inspect starts the inspector but lets the script run immediately, so you may miss early breakpoints. --inspect-brk pauses on the first line, giving you time to attach and set breakpoints before any code executes.

Why do my breakpoints hit the wrong lines in TypeScript?

Breakpoints land on the emitted JavaScript, not the .ts source. Either set breakpoints in the built dist/*.js files, or run with --enable-source-maps and use a CDP client that follows sourcemaps, since the node inspect CLI does not.

Can I capture a CPU profile or heap snapshot without Chrome DevTools?

Yes, use chrome-remote-interface to drive the Profiler and HeapProfiler domains programmatically. Start and stop Profiler for a .cpuprofile, or call takeHeapSnapshot and write the chunks to a .heapsnapshot file for later analysis.

When should I not use breakpoint debugging for Node.js?

Skip it when console.log answers the question in under a minute, since breakpoint-driven debugging is heavier. Also note that Python child processes need a different debugger such as debugpy, not the V8 inspector.