node-inspector调试报错问题处理
使用node-inspector调试的时候,提示下面的异常,我的node版本是6.9.2出现下面的异常,我同事的版本4.2.1就没有这个问题。
C:\Users\dzm>node-inspector --web-port=8888
Node Inspector v0.12.8
Visit http://127.0.0.1:8888/?port=5858 to start debugging.
C:\Users\dzm\AppData\Roaming\npm\node_modules\node-inspector\lib\InjectorClient.
js:111
cb(error, NM[0].ref);
^
TypeError: Cannot read property 'ref' of undefined
at InjectorClient.<anonymous> (C:\Users\dzm\AppData\Roaming\npm\node_modules
\node-inspector\lib\InjectorClient.js:111:22)
at C:\Users\dzm\AppData\Roaming\npm\node_modules\node-inspector\lib\Debugger
Client.js:121:7
at Object.value (C:\Users\dzm\AppData\Roaming\npm\node_modules\node-inspecto
r\lib\callback.js:23:20)
at Debugger._processResponse (C:\Users\dzm\AppData\Roaming\npm\node_modules\
node-inspector\lib\debugger.js:95:21)
at Protocol.execute (_debugger.js:121:14)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
解决办法是找到C:\Users\dzm\AppData\Roaming\npm\node_modules\node-inspector\lib\InjectorClient.
的第111行,修改如下:
js