vscode断点启动无效

  |  

之前调试一直好好的,前天突然有一次vscode 调试node,启动成功了,但是postman访问不了了,显示访问超时
但是在launch.json文件中的配置是

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\app.js"
}
]
}

后来找了一些资料,原来还需要在终端启动服务,发现需要增加配置,如下,这个会在终端和调试控制台都启动服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
    "configurations": [
        {
            "type""node",
            "request""launch",
            "name""nodemon",
            "runtimeExecutable""nodemon",
            "program""${workspaceFolder}/app.js",
            "restart"true,
            "console""integratedTerminal",
            "internalConsoleOptions""neverOpen"
        }
    ]
}
文章目录