发布于 2018-07-12 06:44:23
按F5键,选择节点,将launch.json文件替换为:
{
// 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": "Debug Nest Framework",
"args": ["${workspaceFolder}/src/main.ts"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"protocol": "inspector"
}
]
}因此,设置一个断点并再次点击F5。
发布于 2020-03-09 23:03:42
如果您使用的是nestjs 6.8+ (参见here)
在包含此内容的.vscode文件夹中添加launch.json
{
// 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": "attach",
"name": "Attach NestJS WS",
"port": 9229,
"restart": true,
"stopOnEntry": false,
"protocol": "inspector",
"skipFiles": [
"<node_internals>/**/*.js",
"${workspaceRoot}/node_modules/**/*.js",
]
}
]
}然后运行npn run start:debug
然后在vscode中选择Attach NestJs Ws
完成了!您可以设置断点

https://stackoverflow.com/questions/50775206
复制相似问题