I try to debug my server.js app with node-inspector (v0.12.8), nodejs (v5.9.1) and chrome (v49.0.2623.112 m) under windows environment.
In a shell i do
node-inspector
Node Inspector v0.12.8 Visit http://127.0.0.1:8080/?port=5858 to start debugging.
In a second shell i do
node --debug server.js
When i go to chrome tab i obtain a message:
Detached from target
remote debug has been terminated with reason: websocket_closed
please reattach to the new target
In the console dev tool of chrome i can see either a message that inspector can't find experimental function canvasInspection (removed in the latest chrome version).
I'm doing something wrong?
Using Google Chrome DevTools to Debug To start debugging, let's run our application with the --inspect-brk flag. The next step is to head to Chrome, open a new tab, and enter the URL chrome://inspect/ . Click on “Open dedicated DevTools for Node” to start debugging the application.
Open the starting file (typically index. js ), activate the Run and Debug pane, and click the Run and Debug Node. js (F5) button. The debugging screen is similar to Chrome DevTools with a Variables, Watch, Call stack, Loaded scripts, and Breakpoints list.
The node-debug command will load Node Inspector in your default browser. NOTE: Node Inspector works in Chrome and Opera only.
I had the same problem, I fixed it the way below:
1- Go and edit the following file in your currently in use nodejs path:
...\node_modules\node-inspector\lib\InjectorClient.js
2- Go to line 111
. if you're using vim as text editor you can do it by command :111
3- Add the following if
statement at line 111
and indent the next line.
if(NM.length > 0)
cb(error, NM[0].ref);
4- Save and re-run node-inspector
.
Cheers!
I'm using MacOS Sierra, Node v6.3.1. But the solution is general.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With