I am trying to compile and run a C++ file using execSync(). It works fine when there are no compilation errors. But when a compile time error occurs the output returned by execSync() is an empty buffer. How do I get the error message ?
This is my code:
This is the returned output that I'm trying to capture: