egg.js_调试方式_DevTools/vscode(by official document)

reference link

(eggjs.org)

使用 [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
        }
    ]
}

关于配置里的端口,应该避免和当前的被占用的端口号重合,或者调试前关闭其他端口
在这里插入图片描述

おすすめ

転載: blog.csdn.net/xuchaoxin1375/article/details/121848447