如何用vscode调试nodejs express框架的项目?

点击Add Configuration,添加nodeJs的launch.json
在这里插入图片描述
编辑launch.json,设置launch.json如下即可:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/bin/www",
            "skipFiles": [
                "<node_internals>/**"
            ]
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Attach",
            "port": 5858
        }
    ]
}

运行:
在这里插入图片描述

发布了125 篇原创文章 · 获赞 8 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/ll837448792/article/details/103330363