节点检查器 - debug-brk在第一行没有中断

时间:2012-04-03 19:08:52

标签: node.js node-inspector

我已安装了node-inspector,并已通过node启动它。 当我尝试使用--debug-brk启动调试模式时,它仍然出错(这是我正在尝试调试的错误)

它不会在第一行中断......

$ node --debug-brk app.js

debugger listening on port 5858

/base_controller.js:59
        files.forEach(function(file) {
        ^
TypeError: Cannot call method 'forEach' of undefined
    at Object.oncomplete (/base_controller.js:59:9)

2 个答案:

答案 0 :(得分:0)

已安装node-inspector:https://github.com/node-inspector/node-inspector

尝试以下步骤:

首先:节点--debug-brk app.js

第二:节点检查员

然后: 用chrome打开一个新的winow,打开网址:

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

您现在可以调试代码!

答案 1 :(得分:-1)

也许你没有运行最新版本(它发生在我身上)。请做

$ node
> process.version

那应该给你最后一个版本。您可以在此处更新:http://nodejs.org/