0
0
Node.jsframework~10 mins

Node.js built-in debugger in Node.js - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the Node.js debugger with a script named app.js.

Node.js
node [1] app.js
Drag options to blanks, or click blank then click option'
A--watch
Bdebug
C--inspect
D--run
Attempts:
3 left
💡 Hint
Common Mistakes
Using --inspect instead of debug starts the inspector, not the legacy debugger.
Using --watch or --run are invalid for debugging.
2fill in blank
medium

Complete the code to start Node.js with the modern debugger listening on port 9229.

Node.js
node [1]=9229 app.js
Drag options to blanks, or click blank then click option'
A--debug
B--trace
C--inspect
D--profile
Attempts:
3 left
💡 Hint
Common Mistakes
Using --debug is deprecated and replaced by --inspect.
Using --trace or --profile does not start the debugger.
3fill in blank
hard

Fix the error in the code to start the debugger and pause execution on the first line.

Node.js
node --inspect-brk=[1] app.js
Drag options to blanks, or click blank then click option'
A9229
Bdebug
Cstart
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Passing 'debug' or 'true' causes an error because the flag expects a port number.
Omitting the port number or using invalid values.
4fill in blank
hard

Fill both blanks to start the Node.js debugger and open the inspector on port 9230.

Node.js
node [1]=[2] app.js
Drag options to blanks, or click blank then click option'
A--inspect
B9229
C9230
D--debug
Attempts:
3 left
💡 Hint
Common Mistakes
Using --debug instead of --inspect starts the legacy debugger.
Using the wrong port number causes connection issues.
5fill in blank
hard

Fill all three blanks to start Node.js with the debugger, pause on the first line, and enable the inspector on port 9240.

Node.js
node [1] [2]=[3] app.js
Drag options to blanks, or click blank then click option'
A--inspect-brk
B--inspect
C9240
D--debug
Attempts:
3 left
💡 Hint
Common Mistakes
Using --debug instead of --inspect for modern debugging.
Not specifying the port or using the wrong flag order.