【问题标题】:Deno - Could not target to debug targetDeno - 无法定位到调试目标
【发布时间】:2021-04-28 07:41:10
【问题描述】:

我有相同的配置来为 Deno 运行调试,并且它在 Pop OS 上运行良好,直到它崩溃并且我再次安装了 Ubuntu 20.04。

这是我的launch.json

{
  "configurations": [
  {
    "type": "pwa-node",
    "request": "launch",
    "name": "Launch Deno",
    "program": "${workspaceFolder}/index.ts",
    "cwd": "${workspaceFolder}",
    "runtimeExecutable": "/home/transonhoang/.deno/bin/deno",
    "runtimeArgs": [
      "run",
      "--inspect-brk=127.0.0.1:9229",
      "--allow-all",
      "--unstable"
    ],
    "attachSimplePort": 9229
  }
  ]
}

当我运行调试时,屏幕将显示如下图所示的弹出窗口:

我真的需要这方面的帮助。感谢您的宝贵时间。

【问题讨论】:

  • 你能确认你使用的Demo版本吗? 1.6 中引入了阻止检查器启动的错误,并在 1.7 中修复
  • @StevenGuerrero 1.6.3 现在。感谢您提供有用的信息。

标签: node.js visual-studio-code deno


【解决方案1】:

这是我弄清楚后的解决方案。

  1. 将launch.json更改为
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Deno",
      "type": "pwa-node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "deno",
      "runtimeArgs": [
        "run",
        "-A",
        "--inspect-brk",
        "--unstable",
        "index.ts"
      ],
      "attachSimplePort": 9229,
      "outputCapture": "std"
    }
  ]
}

  1. 将我的 Deno 版本迁移到 1.7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-27
    • 2016-04-21
    • 2019-02-22
    • 2015-01-23
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    • 2020-09-07
    相关资源
    最近更新 更多