【问题标题】:I get an error "Request Log.enable failed" when run "node --inspect"运行“node --inspect”时出现错误“Request Log.enable failed”
【发布时间】:2016-10-26 11:16:32
【问题描述】:

我正在尝试使用新的 node 6.3+ --inspect 功能运行 node.js 应用程序 (https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27)

但每次我得到下一个错误:

inspector.js:4418 Request Log.enable failed. {"code":-32601,"message":"'Log.enable' wasn't found"}
dispatchResponse @ inspector.js:4418
dispatch @ inspector.js:4372
_onMessage @ inspector.js:10555

我尝试使用节点 6.9.0、6.9.1、7.0.0、chrome 54、chrome 56、windows 7/10。没有任何工作。 谁能帮我解决这个问题?

【问题讨论】:

  • 我能够将日志消息输入控制台执行以下步骤: 1. 切换到 Sources 选项卡; 2. 关闭控制台抽屉; 3.刷新页面;不过有点奇怪……

标签: node.js debugging google-chrome-devtools inspect


【解决方案1】:

我发现在 Chrome 上卸载 NiM(节点检查器管理器)并手动将 URL 复制粘贴到 Chrome 中似乎可以让控制台再次工作。

另一种解决方法是使用其他工具进行调试。

Node 文档有一个列表:https://nodejs.org/en/docs/inspector/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-02
    • 2018-02-07
    • 2016-12-16
    • 2019-08-28
    • 2015-08-01
    • 2019-11-02
    • 2016-01-19
    • 1970-01-01
    相关资源
    最近更新 更多