node-inspect-debugger

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

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill node-inspect-debugger-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: node-inspect-debugger
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/skills/software-development/node-inspect-debugger
Command: npx skills add https://github.com/xu1713/openhorse --skill node-inspect-debugger-xu1713

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 the built-in node inspect CLI 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 or agent-driven 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 with unclear state. Launch it with node --inspect-brk, attach the debugger, set a breakpoint at the suspect line, and inspect closure variables that console.log cannot reach. ## Quick Start Ask the agent to launch your Node script with --inspect-brk, attach the node inspect debugger, 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 an already running Node process?

Send SIGUSR1 to the process with kill -SIGUSR1 <pid> to enable the inspector, then attach with node inspect -p <pid> or via 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 keeps the script running, so early breakpoints may be missed. --inspect-brk pauses on the first line, letting you set breakpoints before any code executes.

Why do my breakpoints hit the wrong lines in TypeScript files?

Breakpoints bind to the emitted JavaScript, not the .ts source. Either break in the built dist/*.js files or run Node 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?

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