This post goes over how to debug Node.js with Chrome.
inspect
Launch the internal debugger of Node.js:
node inspect <file>
--inspect
Enable Node.js inspector by running your node
script with the --inspect
option:
node --inspect <file>
To launch the V8 inspector for use with Chrome Dev Tools:
- Open Chrome browser
- Go to
chrome://inspect
- Click
inspect
underRemote Target
If you add debugger
to your code and rerun your script with inspector, it will stop at the breakpoint.
--inspect-brk
Similar to --inspect
except it breaks before the user code starts:
node --inspect-brk <file>