function spawnProcess(processArgStr, opts) {
  const processArgs = processArgStr.split(' ');
  // eslint-disable-next-line camelcase
  const proc = child_process.spawn(processArgs[0], processArgs.slice(1), opts);
  /** @type {string} */
  let output;
  proc.stdout.on('data', data => {
    output += data;
    LogService.debug(data.toString());
  });
  return new Promise((resolve, reject) => {
    proc.stderr.on('data', data => {
      LogService.error(data.toString());
      reject(data.toString());
    });
    proc.on('close', code => {
      resolve({ code, output });
    });
  });
}
@param {string} processArgStr
@param {object} [opts]
@returns {Promise<{ code:number; output:string }>}
@throws {Error}