关于node.js:节点检查器调试

Node inspector debugging

我目前无法让节点检查器与Google Chrome一起使用。我在Windows 7 64位上。

这是有关节点检查器的信息:
https://github.com/node-inspector/node-inspector

运行以下命令时

1
node-debug app.js

在名为app.js的简单JavaScript文件上:

1
2
3
4
a = 5;
b = 6;
c = a + b;
console.log(c);

,然后使用以下URL打开Chrome:

1
  http://localhost:8080/debug?port=5858

我得到的只是一个空页面,除了Chrome调试工具栏的一小部分,什么也没加载,无论我做什么,我什至都重新安装了Chrome(以及Canary开发人员版本):

enter


尝试在没有node-debug包装器的情况下启动它。

因此,安装节点检查器:

1
npm install -g node-inspector

在一个终端中:

1
node --debug-brk app.js

在另一个终端中:

1
node-inspector

浏览到http://localhost:8080/debug?port=5858


我有一个类似的问题,进入http://localhost:8080/debug?port=5858将导致页面空白。但是,去http://127.0.0.1:8080/debug?port=5858似乎可以解决问题。


我有同样的问题。然后我卸载了node-inspector,再次安装了它。关闭了安装了node-inspector的cmd提示符(也许此步骤有所作为)。打开另一个cmd提示符以对my.js进行节点调试。我现在可以看到源文件。