SeleniumHQ/selenium · critical · Error
Error executing command for ${smBinary} with ${args}: ${e.to
Error message
Error executing command for ${smBinary} with ${args}: ${e.toString()} What it means
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`.
Source
Thrown at javascript/selenium-webdriver/common/seleniumManager.js:93
let errorMessage
if (spawnResult.stderr.toString()) {
errorMessage = spawnResult.stderr.toString()
}
if (spawnResult.stdout.toString()) {
try {
output = JSON.parse(spawnResult.stdout.toString())
logOutput(output)
errorMessage = output.result.message
} catch (e) {
errorMessage = e.toString()
}
}
throw new Error(`Error executing command for ${smBinary} with ${args}: ${errorMessage}`)
}
try {
output = JSON.parse(spawnResult.stdout.toString())
} catch (e) {
throw new Error(`Error executing command for ${smBinary} with ${args}: ${e.toString()}`, { cause: e })
}
logOutput(output)
return {
driverPath: output.result.driver_path,
browserPath: output.result.browser_path,
}
}
function logOutput(output) {
for (const key in output.logs) {
if (output.logs[key].level === 'WARN') {
log_.warning(`${output.logs[key].message}`)
}
if (['DEBUG', 'INFO'].includes(output.logs[key].level)) {
log_.debug(`${output.logs[key].message}`)
}
}View on GitHub (pinned to aa36b38e69)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try {
const result = binaryPaths(args)
} catch (e) {
if (e.cause && e.cause instanceof SyntaxError) {
console.error('Selenium Manager output was not JSON. Check SE_MANAGER_PATH and binary version.')
}
throw e
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unable to obtain Selenium Manager at ${filePath}
- SE_MANAGER_PATH does not point to a file: {env_path}
- Unsuccessful command executed: #{command}; #{e.message}
- Unable to obtain browser driver. For more informatio
- Error executing command for ${smBinary} with ${args}: ${erro
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/6c925068cec418d6.
Report an issue: GitHub.