Debugging Visual Studio代码中的Launch.json
要在Visual Studio代码中开始调试,我必须生成一个Launch.json文件。 在Visual Studio代码自动生成文件后,我得到了如下内容:Debugging Visual Studio代码中的Launch.json,debugging,visual-studio-code,Debugging,Visual Studio Code,要在Visual Studio代码中开始调试,我必须生成一个Launch.json文件。 在Visual Studio代码自动生成文件后,我得到了如下内容: { "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "node", "request": "launch", "program": "./bin/www", "sto
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "./bin/www",
"stopOnEntry": false,
"args": [],
"cwd": ".",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858
}
]
}
在这个文件中,我可以将参数“request”设置为启动或附加。
“启动”和“附加”之间有什么区别
我认为“启动”只是启动应用程序,“附加”负责附加到节点进程。但我注意到,如果我删除整个“附加”块,我仍然可以调试我的应用程序 从以下方面得到了答案:
在VS代码中,我们支持在调试模式下启动应用程序或连接到已运行的应用程序。根据请求(附加或启动),需要不同的属性,我们的launch.json验证和建议应该会有所帮助