Bird
0
0

After starting Node.js with node --inspect app.js, you see 'Debugger listening on ws://127.0.0.1:9229' but DevTools shows 'Waiting for connection'. What should you do?

medium📝 Debug Q7 of 15
Node.js - Debugging and Profiling
After starting Node.js with node --inspect app.js, you see 'Debugger listening on ws://127.0.0.1:9229' but DevTools shows 'Waiting for connection'. What should you do?
ARestart Node.js with --inspect-brk
BDisable firewall and antivirus permanently
CChange the port to 8080
DOpen Chrome and navigate to chrome://inspect to connect
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to connect DevTools to Node.js

    Chrome DevTools connects via chrome://inspect page where you can attach to the debugger.
  2. Step 2: Evaluate other options

    Restarting with --inspect-brk is optional; changing port is unnecessary; disabling firewall permanently is unsafe and not required.
  3. Final Answer:

    Open Chrome and navigate to chrome://inspect to connect -> Option D
  4. Quick Check:

    Use chrome://inspect to connect debugger [OK]
Quick Trick: Use chrome://inspect to attach DevTools to Node.js [OK]
Common Mistakes:
  • Restarting unnecessarily
  • Changing ports without reason
  • Disabling firewall permanently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes