4º. 1er cuatrimestre. Itinerario de Sistemas de la Información. Grado en Ingeniería Informática. ULL
En la terminal:
➜ node --version
v14.4.0
➜ node --inspect-brk logging-espree.js
Debugger listening on ws://127.0.0.1:9229/331b3011-c7f5-447f-8731-1371c53847a5
For help, see: https://nodejs.org/en/docs/inspector
the option --inspect-brk=[host:port]
does the following:
host
(default: 127.0.0.1)port
(default: 9229)En el navegador abrimos la URL chrome://inspect
y hacemos click
en el enlace inspect
Insert debugger
statements wherever you want to set a break-point:
If the Auto Attach feature is enabled, the Node debugger automatically attaches to certain Node.js processes that have been launched from VS Code’s Integrated Terminal. To enable the feature, either use the Toggle Auto Attach command from the command palette (F1) or, if it’s already activated, use the Auto Attach Status bar item
After enabling Auto Attach, you’ll need to restart your terminal.
See Node.js debugging in VS Code