Bird
0
0

You ran node --prof app.js but the generated log file is empty. What is the most probable reason?

medium📝 Debug Q7 of 15
Node.js - Debugging and Profiling
You ran node --prof app.js but the generated log file is empty. What is the most probable reason?
AThe log file was corrupted during write
BThe app was run with the --prof flag but exited before any JavaScript executed
CYou used an unsupported Node.js version
DThe CPU profiling feature is disabled by default
Step-by-Step Solution
Solution:
  1. Step 1: Understand empty log causes

    If the app exits immediately before running JS code, the log may be empty.
  2. Step 2: Exclude other causes

    CPU profiling is enabled by --prof; supported in recent Node.js; corruption is rare.
  3. Final Answer:

    The app was run with the --prof flag but exited before any JavaScript executed -> Option B
  4. Quick Check:

    Empty log file = app exited before JS ran [OK]
Quick Trick: Empty logs often mean app exited before JS ran [OK]
Common Mistakes:
  • Assuming profiling is off by default
  • Blaming Node.js version without checking
  • Ignoring app exit timing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes