message: Debug logs not flushed to file on process.exit
diff: @@ -57,7 +57,12 @@ function exitWithMessage(message, shortMessage) {
  logger.info("");
  }
  logger.error(message.trimStart());
  - process.exit(1);
  +
  + // Because writing to log file is an async process, calling process.exit directly can cause
  + // some logs not flushed to file. Need to wait for logs to finish flusing and then exit.
  + // https://github.com/winstonjs/winston/issues/228
  + // https://github.com/winstonjs/winston/issues/1504
  + logger.on('finish', () => process.exit(1));
  }
  async function getAppPackageJson() {
  