Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
233 views
in Technique[技术] by (71.8m points)

node.js - Deno - Could not target to debug target

I have same configuration to run debug for Deno and it run well at Pop OS until it crashed and I installed again Ubuntu 20.04.

Here is my 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
  }
  ]
}

When I run debug, the screen will show a popup like image below:

enter image description here

I really need help on this. Thanks for your time.

question from:https://stackoverflow.com/questions/65868875/deno-could-not-target-to-debug-target

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here is my solution after figuring out.

  1. change launch.json to
{
  "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. Migrate my Deno version to 1.7

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...