gpt4 book ai didi

javascript - 如何在 Chrome 中使用 Node 8 检查器?

转载 作者:IT老高 更新时间:2023-10-28 23:19:41 25 4
gpt4 key购买 nike

我熟悉使用 --inspect 选项,因为 Node 7 或其他东西。现在在 Node 8 上,它只是不工作。今天我要求node像往常一样使用inspector:

$ node --inspect --debug-brk node_modules/mocha/bin/_mocha o/**/*.test.js

它会这样回应:

Debugger listening on ws://127.0.0.1:9229/97a6264d-a751-4467-ac36-172ff3ebaac1
For help see https://nodejs.org/en/docs/inspector

如果我尝试打开该链接,Chrome 会说:

This site can’t be reached

The webpage at ws://127.0.0.1:9229/97a6264d-a751-4467-ac36-172ff3ebaac1 might be temporarily down or it may have moved permanently to a new web address.
ERR_DISALLOWED_URL_SCHEME

之前它是一个“chrome-devtools://”链接,效果非常好。

什么给了?

四处搜索,我找不到任何我应该用这个 ws:// 链接做的事情。

最佳答案

information来自 nodejs 文档

Option 1: Open chrome://inspect in a Chromium-based browser. Click the Configure button and ensure your target host and port are listed. Then select your Node.js app from the list.

Option 2: Install the Chrome Extension NIM (Node Inspector Manager)

我更喜欢选项 2。

--debug-brk 也已弃用。 Node.js 8.x 使用 --inspect-brk

关于javascript - 如何在 Chrome 中使用 Node 8 检查器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44750727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com