我已安装了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)
答案 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)