重现步骤。
文件名为
index.js
及其内容:'use strict'; debugger; let a = 10; // doesn't mean anything in regards to the issue.
针对该文件运行
node-debug
。$ node-debug index.js Node Inspector v0.12.8 Visit http://127.0.0.1:8080/?port=5858 to start debugging. Debugging `index.js` Debugger listening on [::]:5858
它在 Chrome 中打开 UI,并在
debugger
行停止执行。 在Watch Expression
部分中设置监视变量process
。可以在这里轻松检查它。但仅限于此,在Watch Expression
部分。
- 现在尝试在控制台中检查
process
变量。这不起作用。您可以键入变量,但按[Enter]
键不会显示process
变量。它只是添加新行:
这是什么行为?如何让它发挥作用?
最佳答案
我的问题在这里得到解决: Chrome inspector console does not work with version 54.0.2840.99
此外,GitHub 上有一个关于该问题的帖子: https://github.com/node-inspector/node-inspector/issues/951#issuecomment-262441472
关于node.js - Chrome 控制台不适用于 Node 检查器浏览器 UI 中的变量。如何启用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41083622/