1
要在Visual Studio代码中开始调试,我必须生成一个Launch.json文件。 文件已经由Visual Studio代码自动生成后,我有这样的事情:Visual Studio代码中的Launch.json
{
"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
}
]
}
在这个文件中,我可以设置参数“请求”启动或附加。 “launch”和“attach”有什么区别?
我认为“启动”只是启动应用程序,“附加”负责附加到节点进程。但我注意到,如果我删除整个“附加”块,我仍然可以调试我的应用程序。