node-inspect调试时的一个bug修复

来源:赵克立博客 分类: Nodejs 标签:nodejs发布时间:2018-01-15 15:24:07最后更新:2018-01-15 15:28:20浏览:2028
版权声明:
本文为博主原创文章,转载请声明原文链接...谢谢。o_0。
更新时间:
2018-01-15 15:28:20
温馨提示:
学无止境,技术类文章有它的时效性,请留意文章更新时间,如发现内容有误请留言指出,防止别人"踩坑",我会及时更新文章

TypeError: Cannot read property 'ref' of undefined

    at InjectorClient.<anonymous> (C:\Users\KELI\AppData\Roaming\npm\node_modules\node-inspector\lib\InjectorClient.js:110:20)

    at C:\Users\KELI\AppData\Roaming\npm\node_modules\node-inspector\lib\DebuggerClient.js:121:7

    at Object.value (C:\Users\KELI\AppData\Roaming\npm\node_modules\node-inspector\lib\callback.js:23:20)

    at Debugger._processResponse (C:\Users\KELI\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)

解决方法 Node Inspector v0.12.7

打开路径 C:\Users\KELI\AppData\Roaming\npm\node_modules\node-inspector\lib\InjectorClient.js对应的111行修改代码为

if (!NM.length)
  error = new Error('No NativeModule in target scope');
if (NM.length)
  cb(error, NM[0].ref);



微信号:kelicom QQ群:215861553 紧急求助须知
Win32/PHP/JS/Android/Python