samedi 28 septembre 2019

How to get the debugger in node.js working with inspect

I have an algorithm to test in node.js so I want to inspect a for loop with the debugger:

for (let char in charMap) {
   debugger;
}

I tried to inspect the file with 'node inspect [path]' command, but i got this:

$ node inspect .\maxChar.js
Timeout (2000) waiting for 127.0.0.1:9229 to be free

Then, i tried the following command to change the port to 9230, but it's still not working:

$ node --inspect=127.0.0.1:9230 inspect .\maxChar.js
Debugger listening on ws://127.0.0.1:9230/6ff23aac-0979-4399-a3e3-a076239253e1
For help, see: https://nodejs.org/en/docs/inspector
Timeout (2000) waiting for 127.0.0.1:9229 to be free

How can i get the node inspect to work ?

Aucun commentaire:

Enregistrer un commentaire