node-debug on windows doesn't work.
See original GitHub issueIt’s kind of unclear if node-debug script.js
should work on windows. Is it supposed to work?
In my case it does not work, I get this error:
C:\test>node-debug test.js
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging `test.js`
Debugger listening on [::]:5858
C:\Users\pps\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\pps\AppData\Roaming\npm\node_modules\node-inspector\lib\InjectorClient.js:111:22)
at C:\Users\pps\AppData\Roaming\npm\node_modules\node-inspector\lib\DebuggerClient.js:121:7
at Object.value (C:\Users\pps\AppData\Roaming\npm\node_modules\node-inspector\lib\callback.js:23:20)
at Debugger._processResponse (C:\Users\pps\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:543:20)
events.js:160
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:1026:11)
at TCP.onread (net.js:564:26)
C:\test>
while I get that error in console I get chrome-inspector started and I always get this error there.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
How to use Node's debug module (Windows)? - Stack Overflow
Install debug package with npm inside the node application npm install debug. Open a powershell and then
Read more >Debugger does not work when running Node.js on ... - GitHub
I am using the portable builds of node and vscode, but had no issues with them before. Only the debugging never worked. Every...
Read more >Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >NodeJS 17 debugger doesn't work on Windows with IPv6
NodeJS 17 debugger doesn't work on Windows with IPv6 · Set environment variable JB_IDE_HOST=127.0.0.1 · Configure Windows to prefer IPv4 over IPv6 ·...
Read more >Set up Node.js on WSL 2 - Windows - Microsoft Learn
Windows doesn't automatically handle this update. ... versions of Node.js based on the needs of different projects you're working on.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
just I see others:
Try this hack/workaround Seek in /usr/lib64/node_modules/node-inspector/lib/InjectorClient.js (your location of node-inspector) Look at Function InjectorClient.prototype._getFuncWithNMInScope
Replace this
cb(null, result.handle); with this
cb(null, result.constructorFunction.ref); I have this message in node-ispector console tab
Internal error: TypeError: Cannot read property ‘0’ of undefined But breakpoints and other stuff works. Tested with 6.6.0
P.s. Seems node-inspector method for retrieval NativeModule link fails to handle -1 even with #906 or similar because this solves problem with response, but not with request. You will recieve this message
Error: No NativeModule in target scope and you will not able to go through breakpoints with node-inspector’s UI.
The problem is here: https://github.com/node-inspector/node-inspector/blob/master/lib/InjectorClient.js#L98-L113
Test
if (!NM.length)
should call cb and return