{"record":{"id":"f909becaf95cc1fc","repo":"stablyai/orca","slug":"wsl-distro-distro-needs-node-js-18-or-newer-t","errorCode":null,"errorMessage":"WSL distro '${distro}' needs Node.js 18 or newer to run Orca's relay","messagePattern":"WSL distro '(.+?)' needs Node\\.js 18 or newer to run Orca's relay","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/wsl-hook-relay-reattach-benchmark.mjs","lineNumber":276,"sourceCode":"}\n\nasync function main() {\n  if (process.platform !== 'win32') {\n    throw new Error('This benchmark requires a Windows host with WSL')\n  }\n  const options = parseArgs(process.argv.slice(2))\n  const distro = await resolveDistro(options.distro)\n  const nodeVersion = await run(\n    'wsl.exe',\n    wslArgs(distro, [\n      '/bin/sh',\n      '-c',\n      'for node_bin in \"$(command -v node 2>/dev/null || true)\" \"$HOME/.local/bin/node\"; do [ -x \"$node_bin\" ] || continue; \"$node_bin\" -p process.versions.node && exit 0; done; exit 1'\n    ]),\n    { allowFailure: true }\n  )\n  if (nodeVersion.status !== 0 || Number(nodeVersion.stdout.trim().split('.')[0]) < 18) {\n    throw new Error(`WSL distro '${distro}' needs Node.js 18 or newer to run Orca's relay`)\n  }\n\n  const bundleDir = join(process.cwd(), 'out', 'relay', 'wsl')\n  const bundlePath = join(bundleDir, 'wsl-agent-hook-relay.js')\n  const versionPath = join(bundleDir, '.version')\n  if (!existsSync(bundlePath) || !existsSync(versionPath)) {\n    await run(process.execPath, [join('config', 'scripts', 'build-relay.mjs')], {\n      cwd: process.cwd()\n    })\n  }\n\n  // Why: main's PTY graph reads app paths at import time; keep it inside a disposable directory.\n  let userDataDir\n  let ptyIpc\n  let cleanupPaths = []\n  let manager = null\n  let staller = null\n  try {","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/wsl-hook-relay-reattach-benchmark.mjs#L258-L294","documentation":"Version gate: the benchmark shells into the WSL distro, finds a node binary (PATH node or ~/.local/bin/node), and requires Node >= 18 to run Orca's relay bundle. Thrown when the probe fails (status !== 0) or the major version is below 18. The relay ships as ESM/native-API code that needs Node 18+ runtime features.","triggerScenarios":"The distro has no node binary on PATH or in ~/.local/bin, or it has Node 16/14/17. The probe loop runs `node -p process.versions.node` and parses the major.","commonSituations":"Fresh Ubuntu/Debian WSL distros that ship older Node, distros where the user installed Node via an outdated nvm default, or minimal distros with no Node at all.","solutions":["Install Node 18+ in the WSL distro (NodeSource setup script, nvm install --lts, or apt with the nodesource repo).","Ensure the node binary is on PATH or symlinked at ~/.local/bin/node (the probe checks both).","Re-run `wsl.exe -d <distro> node -p process.versions.node` to confirm the major is >= 18.","If using nvm, make sure the default alias points at an 18+ release (`nvm alias default 20`)."],"exampleFix":"// before\nif (nodeVersion.status !== 0 || Number(nodeVersion.stdout.trim().split('.')[0]) < 18) {\n  throw new Error(`WSL distro '${distro}' needs Node.js 18 or newer to run Orca's relay`)\n}\n\n// after — report what was found\nconst major = nodeVersion.status === 0 ? Number(nodeVersion.stdout.trim().split('.')[0]) : null\nif (nodeVersion.status !== 0 || major == null || major < 18) {\n  throw new Error(`WSL distro '${distro}' needs Node.js 18+; found: ${nodeVersion.stdout.trim() || 'no node binary'}`)\n}","handlingStrategy":"validation","validationCode":"// Pre-flight check reusable across benchmarks\nasync function assertGuestNodeMin(distro: string, minMajor: number): Promise<void> {\n  const r = await run('wsl.exe', wslArgs(distro, ['/bin/sh','-c','node -p process.versions.node']), { allowFailure: true })\n  const major = r.status === 0 ? Number(r.stdout.trim().split('.')[0]) : NaN\n  if (!Number.isInteger(major) || major < minMajor) {\n    throw new Error(`Install Node ${minMajor}+ in distro ${distro}`)\n  }\n}","typeGuard":"function isSupportedNodeMajor(s: string): boolean {\n  const major = Number(s.trim().split('.')[0])\n  return Number.isInteger(major) && major >= 18\n}","tryCatchPattern":null,"preventionTips":["Pin a known-good Node via nvm in the distro setup script.","Have the benchmark print the install command when this fires.","Verify `node -p process.versions.node` from a manual wsl.exe shell before reporting bugs."],"tags":["wsl","benchmark","node-version","runtime-requirement"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}