如何从 VSCode 控制台中删除 "Waiting for the debugger to disconnect..."

How to remove "Waiting for the debugger to disconnect..." from VSCode console

当我 运行 在 VSCode 控制台中显示任何内容时

Debugger listening on ws://127.0.0.1:51890/cf1cb459-52b1-447f-8f78-aa5e8ff4caef
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...

它会变得非常烦人和分散注意力,例如当 运行ning npm run buildmy project 的根文件夹中时,我得到

...
Single-sourcing version 1.75.47 ./package.json → ./wiki/Install.md (vss @ vss.js:18)
Version single-sourced successfully. (vssEverything @ vss.js:56)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52359/30b1bfed-fe8a-4029-865f-33d90d7b1125
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 copy-python-files
> npm run copy-python-package && npm run copy-python-license && npm run copy-python-keys && npm run copy-python-readme

Debugger listening on ws://127.0.0.1:52362/b333d457-5501-469d-884f-cc43013bcbac
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 copy-python-package
> node build/copy package.json python/package.json

Debugger listening on ws://127.0.0.1:52366/d38e4e81-c873-43f5-844c-b3e866ab70ab
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Copied package.json → python/package.json (<anonymous> @ copy.js:21)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52369/26fe0dac-96e9-4670-8203-373b0b0d1496
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 copy-python-license
> node build/copy LICENSE.txt python/LICENSE.txt

Debugger listening on ws://127.0.0.1:52372/6403694a-eb8c-4569-aa5e-8389ac49019d
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Copied LICENSE.txt → python/LICENSE.txt (<anonymous> @ copy.js:21)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52375/1a00964d-1430-4adb-aada-5f4a57f79c9e
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 copy-python-keys
> node build/copy keys.json python/keys.json

Debugger listening on ws://127.0.0.1:52378/c4ed3532-fd4d-4219-a948-0c8d8df2aca4
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Copied keys.json → python/keys.json (<anonymous> @ copy.js:21)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52381/8cc353a9-7d45-4fff-8c8e-f433bef956c6
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 copy-python-readme
> node build/copy README.md python/README.md

Debugger listening on ws://127.0.0.1:52384/5147b76f-1ad0-4c21-934f-acfd98329745
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Copied README.md → python/README.md (<anonymous> @ copy.js:21)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52387/3e7f92f1-6a7f-4860-b2a1-fb22ef0ee851
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 check-js-syntax
> node -e "console.log(process.cwd())" && eslint --version && eslint "js/*.js" --cache --cache-location .cache/eslintcache --cache-strategy metadata

Debugger listening on ws://127.0.0.1:52390/51818977-0d73-4a12-99d3-bff2a32013b6
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
/Users/sam/Documents/dev/CCXT/ccxt
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52393/dafd01be-ae41-4e69-aa15-71708e3958b7
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
v8.8.0
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52396/ae193df2-afb7-4157-9bd7-7090aac6a63b
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52399/381dc316-b3ba-482e-ad94-1eed5b7768a6
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 browserify
> browserify ./ccxt.browser.js > ./dist/ccxt.browser.js

Debugger listening on ws://127.0.0.1:52402/8f8a22d8-1bc6-4a56-892c-f25ad6aa7658
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:52406/8c4655cf-fb3b-4091-8269-cbadde6686f5
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> ccxt@1.75.47 transpile
> node build/transpile

Debugger listening on ws://127.0.0.1:52411/7d1ba3ae-5cd5-4a6a-98a0-c2b0b501e569
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
...

问题选项卡显示工作区中未检测到任何问题

但我的调试控制台显示 没有可用的调试器,无法发送 'variables'


我可以看到在我的 运行 和“调试”选项卡中启动了一堆进程,但我真的不知道如何处理它们


Launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
          "type": "pwa-node",
          "request": "launch",
          "name": "Launch Program",
          "program": "${workspaceRoot}/examples/js/cli.js",
          "console": "integratedTerminal",
          "outputCapture": "std"
        }
    ]
  }

对于这个问题,有很多种解法。有人说编辑launch.json,有人说可能有语法错误,有人说可以设置断点调试...

这是我在 Whosebug 中找到的 link:enter link description here,您可以查看并检查您的。

希望对您有所帮助!

据我了解,这是由于 2 个主要原因造成的,第一个是当您将 --inspect 标志与 node 命令一起使用时,它会自动将调试器附加到您的进程,您可以在 node 官方网站上阅读更多相关信息- https://nodejs.org/en/docs/guides/debugging-getting-started/#enable-inspector.

如果不是第一种情况,那么第二个原因是您的 IDE 设置,在 VS 代码中,我们可以将我们的调试器配置为自动附加到任何节点进程,请务必正确配置它。

要打开设置选项卡,请按“⌘”(对于 MAC)和“CTRL+”(在 windows 中)。搜索 auto attach filter.

正如您在图像中看到的那样,自动附加设置为始终,因此无论何时启动节点进程,它都会自动将调试器附加到它。根据您的要求更改此设置。

将有 4 个选项,其中一个将禁用,这将禁用自动附加功能,因此当您 运行 您的节点进程时,调试器将不会自动附加。您可以阅读有关自动附加的更多信息 here.

根据需要配置。