{"record":{"id":"6c925068cec418d6","repo":"SeleniumHQ/selenium","slug":"error-executing-command-for-smbinary-with-arg-6c9250","errorCode":null,"errorMessage":"Error executing command for ${smBinary} with ${args}: ${e.toString()}","messagePattern":"Error executing command for (.+?) with (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"javascript/selenium-webdriver/common/seleniumManager.js","lineNumber":93,"sourceCode":"    let errorMessage\n    if (spawnResult.stderr.toString()) {\n      errorMessage = spawnResult.stderr.toString()\n    }\n    if (spawnResult.stdout.toString()) {\n      try {\n        output = JSON.parse(spawnResult.stdout.toString())\n        logOutput(output)\n        errorMessage = output.result.message\n      } catch (e) {\n        errorMessage = e.toString()\n      }\n    }\n    throw new Error(`Error executing command for ${smBinary} with ${args}: ${errorMessage}`)\n  }\n  try {\n    output = JSON.parse(spawnResult.stdout.toString())\n  } catch (e) {\n    throw new Error(`Error executing command for ${smBinary} with ${args}: ${e.toString()}`, { cause: e })\n  }\n\n  logOutput(output)\n  return {\n    driverPath: output.result.driver_path,\n    browserPath: output.result.browser_path,\n  }\n}\n\nfunction logOutput(output) {\n  for (const key in output.logs) {\n    if (output.logs[key].level === 'WARN') {\n      log_.warning(`${output.logs[key].message}`)\n    }\n    if (['DEBUG', 'INFO'].includes(output.logs[key].level)) {\n      log_.debug(`${output.logs[key].message}`)\n    }\n  }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/javascript/selenium-webdriver/common/seleniumManager.js#L75-L111","documentation":"Thrown by binaryPaths() when selenium-manager exits with status 0 (success) but its stdout cannot be parsed as JSON. The wrapper expects a JSON object containing result.driver_path and result.browser_path. A JSON.parse failure triggers this with the parse error stringified and set as `cause`.","triggerScenarios":"SE_MANAGER_PATH points to an older/custom selenium-manager that outputs plain text; a shell wrapper or alias injects non-JSON text into stdout; antivirus or logging middleware corrupts stdout; version mismatch between the JS bindings and the binary.","commonSituations":"Pointing SE_MANAGER_PATH to a system selenium-manager of a different version; a corporate wrapper script around the binary that prints banners; mismatched selenium-webdriver package and binary versions after a partial upgrade.","solutions":["Unset SE_MANAGER_PATH to use the bundled binary, or point it to the exact version bundled with this package.","Remove any shell wrapper or alias that wraps the selenium-manager binary.","Reinstall/upgrade selenium-webdriver so the binary and JS bindings match.","Check for antivirus or monitoring tools that inject into child process stdout."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const result = binaryPaths(args)\n} catch (e) {\n  if (e.cause && e.cause instanceof SyntaxError) {\n    console.error('Selenium Manager output was not JSON. Check SE_MANAGER_PATH and binary version.')\n  }\n  throw e\n}","preventionTips":["Unset SE_MANAGER_PATH unless you are certain it points to the exact bundled binary version.","Remove shell wrappers or aliases that intercept the selenium-manager binary.","Keep the selenium-webdriver package and its bundled binary in sync via clean reinstalls.","Check for antivirus/monitoring tools that inject into child process stdout."],"tags":["selenium-manager","parsing","binary","version","environment"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}