reference link
使用 [DevTools]进行调试
找到连接直接打开(推荐)
打开控制台选项卡
vscode debug
for vscode: (eggjs.org)
或者,直接在.vscode
中创建一个launch.json
,并写入一下内容:(F5)启动调试
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Egg",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"windows": {
"runtimeExecutable": "npm.cmd"
},
"runtimeArgs": [
"run",
"debug"
],
"console": "integratedTerminal",
"protocol": "auto",
"restart": true,
"port": 9229,
"autoAttachChildProcesses": true
}
]
}
关于配置里的端口,应该避免和当前的被占用的端口号重合,或者调试前关闭其他端口