如果 Node.js 应用程序使用 --inspect--inspect-brk 标志启动,则可以从 运行 工具窗口或从 调试 工具窗口中的内置 终端 开始调试。

  1. 终端 运行应用程序并输入: node --inspect-brk <应用程序起始页相对于项目根目录的路径>

  2. 终端 工具窗口显示信息消息 Debugger listening <host>:<port> ,默认端口为 9229 。要开始调试,请按住 Ctrl+Shift 并点击链接。

    Attach the debugger to a running Node.js app from the built-in Terminal