1

网上方法

如果用了tsconfig.paths功能就报错

{
  "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",
          "console": "integratedTerminal"
      }
  ]
}

根据nodemon-debug.json改良后

{
  "version": "0.2.0",
  "configurations": [
      {
          "type": "node",
          "request": "launch",
          "name": "Debug Nest Framework",
          "args": ["${workspaceFolder}/src/main.ts"],
          "runtimeArgs": ["--nolazy", "-r", "ts-node/register", "-r", "tsconfig-paths/register"],
          "sourceMaps": true,
          "cwd": "${workspaceRoot}",
          "protocol": "inspector",
          "console": "integratedTerminal"
      }
  ]
}

debugger 已有进程(npm run start:debug)

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to node",
            "type": "node",
            "request": "attach",
            "restart": true,
            "processId": "${command:PickProcess}"
        }
    ]
}

放羊的馨馨
24 声望6 粉丝

前端