5

I run this at the command line:

$ node --inspect --debug-brk  test/src/dev/node/define/1.test.js
Debugger listening on ws://127.0.0.1:9229/93a5524a-ae0a-4aa2-a985-3cd6ac6a2b9f
For help see https://nodejs.org/en/docs/inspector

normally this commands spits out a url that I copy and paste to the browser. At some point it also auto-opened Chrome to the right url so I could start debugging immediately which was very nice. But now it doesn't log the url to open, nor does it auto-open the url! Damn.

Note that the following url is not the right one to open:

ws://127.0.0.1:9229/93a5524a-ae0a-4aa2-a985-3cd6ac6a2b9f

Anybody seen this with Node.js versions 6+?

4

2 回答 2

5

我不知道为什么 url 不再打印在控制台中,这是一个谜,但是如果您查看文档:

https://nodejs.org/en/docs/inspector/#chrome-devtools-55

它说:

Chrome 开发者工具 55+

选项 1:在基于 Chromium 的浏览器中打开 chrome://inspect。单击配置按钮并确保列出您的目标主机和端口。然后从列表中选择您的 Node.js 应用程序。

选项 2:安装 Chrome 扩展 NIM(节点检查器管理器): https ://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

我认为这些选项之一将适用于在 OP 中面临问题的用户。两者都为我工作。使用 NIM,我将其切换为自动打开,然后它又开始自动打开,这很棒,不知道为什么它曾经关闭过。

于 2017-11-20T09:31:08.457 回答
2

我正在使用以下链接查看所有远程连接的调试器: chrome://inspect/#devices

运行调试器,在 chrome 中打开上面的链接,你应该会看到连接调试器的链接

于 2017-11-20T09:51:23.860 回答