1

I know that these are some similar / duplicate responses when searching for a solution to this. But the Node world seems to update so regularly that any answers I've found are refering to a much older version.

I'm currently running:

  • Node v6.9.1
  • Node Inspector v0.12.8

The error I get is as follows:

Detached from the target

Remote debuggng has been terminated with reason: websocket_closed

please re-attach to the new target

Screenshot of Error

Andrew Birks
  • 792
  • 9
  • 26
  • 1
    Why use `node-inspector` when the version of node you're using has a built-in V8 inspector? Just do `node --inspect --debug-brk foo.js`. – mscdex Nov 01 '16 at 10:40
  • @mscdex - Thanks, I'm now trying this approach. Is this considered the norm? Using the core debugger now? – Andrew Birks Nov 01 '16 at 11:30
  • Well, it's certainly handier (being built-in) and being maintained by the V8 team. – mscdex Nov 01 '16 at 18:15

2 Answers2

0

I had an identical issue. After digging around on some forums, I found that downgrading to Node v6.3.1. Here

So the next question was "How do I manage versions of node". Plenty of results show up with nvm. Stack Overflow has a post on it here.

None of the version managers for windows are kept up with. I found another one that is kept up to date (as of 1/1/17). I posted that answer here

Back to the original problem, with the nvm-windows installed:

nvm install v6.3.1 //I was running 6.9.1 - downgrade

The utility downgrades your npm version

Downloading npm version 3.10.3....complete
Installing npm v3.10.3

Then use it

nvm use 6.3.1

Note - I use a bunch of IDEs / Editors (depending on what I am doing). Editors such as Atom or WebStorm which have a Terminal / Command prompt embeded in it will need to be restarted AFTER you install nvm-windows in order to get access to the environment command "nvm".

Once you have node downgraded, the node-inspector worked find for me:

node-debug server.js
Community
  • 1
  • 1
JDBennett
  • 1,323
  • 17
  • 45
0

Maybe node with higher version(6.9.1) built in inspect, and node-inspect don't update longer..

solution:use node --inspect yourapp replace node-inspect & node --debug yourapp It worked for me.

you can see Github issues Detached from the target, websocket_closed, cannot read property ref of undefined (NM[0] is undefined)

John Trump
  • 376
  • 2
  • 15