1.用node 命令执行脚本时加上 --inspect-brk 选项, 如:
PS D:\study\webpack> node --inspect-brk ./src/index.js
Debugger listening on ws://127.0.0.1:9229/2f22da9e-d8d5-4a13-8441-43b0a1eab72d
For help see https://nodejs.org/en/docs/inspector
2.打开chrome浏览器在地址栏输入chrome://inspect/#devices点击enter键进入到以下界面:
3.点击inspect按钮开始断点调试
网友评论