1.vscode打開的文件必須只包含你要調適的項目,不能同時在一個vscode打開多個項目窗口
2.點擊vscode的這個小蜘蛛

3.選擇添加配置

4.此時自動生成了一個文件,launch.json:
你設置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 },
