1.vscode打开的文件必须只包含你要调适的项目,不能同时在一个vscode打开多个项目窗口

2.点击vscode的这个小蜘蛛

使用vscode打断点

 

 

 3.选择添加配置

使用vscode打断点

 

4.此时自动生成了一个文件,launch.json:
使用vscode打断点

 

 

 你设置name并修改路径。保存。

5.此时,按F5就可以调试了。特别有利于node找bug。

 

 

6.如果配置如下:就可以整个项目调试。

 {
            "type": "node",
            "request": "launch",
            "name": "Egg Test",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run",
                "test-local",
                "--",
                "--inspect-brk"
            ],
            "protocol": "auto",
            "port": 9229,
            "autoAttachChildProcesses": true
        },

 

相关文章:

  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-16
  • 2021-08-17
  • 2021-09-06
  • 2021-08-28
  • 2021-12-02
相关资源
相似解决方案