You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Chrome DevTools Node.js专用调试器无法在断点暂停的问题求助

Fixing Breakpoint Issues in Node.js 9.2.0 with Chrome 64 Debugging

Hey there, let's work through this frustrating breakpoint problem you're hitting. I've dealt with similar glitches in older Node-Chrome debug setups, so here are targeted steps to get your breakpoints working:

  • Verify your Node launch command
    Older Node versions (like 9.x) require the --inspect-brk flag to properly pause execution at the start, which helps DevTools catch up before your script runs past breakpoints. Make sure you're starting your script with:
    node --inspect-brk your-script.js
    Skipping -brk can lead to DevTools connecting too late, causing breakpoints to be missed.

  • Check for port conflicts
    The default debug port (9229) might be occupied by another process. To confirm:

    • On Mac/Linux: Run lsof -i :9229
    • On Windows: Run netstat -ano | findstr :9229
      If the port is in use, launch Node with a custom port: node --inspect-brk=9230 your-script.js, then go to chrome://inspect → Configure → add localhost:9230 and reconnect.
  • Rule out Chrome extensions/cache interference
    Extensions or cached data can block debug connections. Try opening Chrome in incognito mode (Ctrl+Shift+N), navigate to chrome://inspect, and connect to your Node process there. You can also disable cache in DevTools' Network tab (check "Disable cache") before refreshing the debug session.

  • Validate your debugger placement
    Double-check that the debugger statement is in code that actually executes. For example, if it's inside an async callback that never fires, or wrapped in a conditional that's never true, it won't trigger. Add a console.log right next to the debugger to confirm that line is being reached.

  • Test with Node's built-in debugger
    To isolate whether the issue is with Chrome or Node itself, try running node debug your-script.js (Node's old CLI debugger). If breakpoints work here, the problem is likely with the Chrome DevTools connection; if not, there's an issue with your script or Node installation.

  • Recheck DevTools connection state
    Ensure you're connecting to the correct Node process in chrome://inspect. Sometimes old DevTools windows hang around connected to terminated processes—close all debug windows, restart your Node script, and re-launch the inspector from chrome://inspect.

If none of these steps resolve the issue, sharing your exact launch command and a small snippet of the code where breakpoints aren't triggering would help narrow things down further.

内容的提问来源于stack exchange,提问作者Govind Rai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:16:47