{"record":{"id":"84aee9b8f433d141","repo":"NousResearch/hermes-agent","slug":"electron-rebuild-failed-for-platform-arch-e","errorCode":null,"errorMessage":"electron-rebuild failed for ${platform}-${arch} (exit ${result.status}). Cannot stage node-pty without a native binary.","messagePattern":"electron-rebuild failed for (.+?)-(.+?) \\(exit (.+?)\\)\\. Cannot stage node-pty without a native binary\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/scripts/stage-native-deps.mjs","lineNumber":329,"sourceCode":"    // binary rather than defaulting to the host's arch.\n    console.log(\n      `[stage-native-deps] no native binary for ${platform}-${arch}; ` +\n        `running electron-rebuild (target arch: ${arch})...`\n    )\n    const rebuildArgs = [\n      '../../node_modules/.bin/electron-rebuild',\n      '-f',\n      '-w',\n      'node-pty',\n      '--arch',\n      arch\n    ]\n    const result = spawnSync(process.execPath, rebuildArgs, {\n      cwd: projectRoot,\n      stdio: 'inherit'\n    })\n    if (result.status !== 0) {\n      throw new Error(\n        `electron-rebuild failed for ${platform}-${arch} (exit ${result.status}). ` +\n          `Cannot stage node-pty without a native binary.`\n      )\n    }\n    // Re-copy build/Release after electron-rebuild populated it.\n    const buildReleaseDir = join(srcRoot, 'build/Release')\n    copyBuildRelease(buildReleaseDir, join(destRoot, 'build/Release'))\n  }\n\n  // Validate every staged .node binary matches the target platform.\n  validateStagedBinaries(destRoot, platform)\n\n  console.log(`[stage-native-deps] staged node-pty (${platform}-${arch}) -> ${destRoot}`)\n  return destRoot\n}\n\nexport function stageNodePty({ platform = process.platform, arch = process.arch } = {}) {\n  const srcRoot = resolveNodePtyRoot()","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/scripts/stage-native-deps.mjs#L311-L347","documentation":"Error \"electron-rebuild failed for ${platform}-${arch} (exit ${result.status}). Cannot stage node-pty without a native binary.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/scripts/stage-native-deps.mjs:329 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the electron-rebuild output, fix the native build error, and rerun.","Ensure the build toolchain for the target platform is installed (headers, compilers).","Use a prebuilt node-pty binary for the target platform instead of rebuilding."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}