Bird
0
0

You ran node --prof app.js but no log file was created. What is a likely cause?

medium📝 Debug Q14 of 15
Node.js - Debugging and Profiling
You ran node --prof app.js but no log file was created. What is a likely cause?
AThe app.js script exited too quickly before profiling started
BYou forgot to run <code>node --prof-process</code> first
CYou used <code>--prof</code> with an unsupported Node.js version
DThe log file is created only if you add <code>--cpu-prof</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand profiling log creation

    The log file is created when the app runs with --prof and exits normally.
  2. Step 2: Analyze why no log appears

    If the app exits too fast, profiling may not start or finish, so no log is saved.
  3. Final Answer:

    The app.js script exited too quickly before profiling started -> Option A
  4. Quick Check:

    App must run long enough to create profile log [OK]
Quick Trick: App must run fully to generate profile log [OK]
Common Mistakes:
  • Thinking --prof-process creates the log file
  • Assuming --cpu-prof is required for logs
  • Blaming Node.js version without checking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes