首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调试nestjs微服务框架

调试nestjs微服务框架
EN

Stack Overflow用户
提问于 2018-06-09 22:19:08
回答 2查看 2K关注 0票数 4

我们如何在vscode中调试nest微服务框架,

这个框架是一个带有springboot约定的typescript项目

http://nestjs.com

EN

回答 2

Stack Overflow用户

发布于 2018-07-12 06:44:23

按F5键,选择节点,将launch.json文件替换为:

代码语言:javascript
复制
{
    // 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。

票数 3
EN

Stack Overflow用户

发布于 2020-03-09 23:03:42

如果您使用的是nestjs 6.8+ (参见here)

在包含此内容的.vscode文件夹中添加launch.json

代码语言:javascript
复制
{
  // 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

完成了!您可以设置断点

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50775206

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档