{"record":{"id":"13031292663d6d11","repo":"NousResearch/hermes-agent","slug":"stage-native-deps-no-prebuilt-binary-for-platf","errorCode":null,"errorMessage":"[stage-native-deps] no prebuilt binary for ${platform}-${arch} and cannot cross-compile native modules from ${process.platform}-${process.arch}. Build on the target platform or provide a prebuild.","messagePattern":"\\[stage-native-deps\\] no prebuilt binary for (.+?)-(.+?) and cannot cross-compile native modules from (.+?)-(.+?)\\. Build on the target platform or provide a prebuild\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/scripts/stage-native-deps.mjs","lineNumber":303,"sourceCode":"  // app that crashes the first time a terminal is spawned.\n  if (hostMatch) {\n    const buildReleaseDir = join(srcRoot, 'build/Release')\n    copyBuildRelease(buildReleaseDir, join(destRoot, 'build/Release'))\n  }\n\n  // Check whether a native binary for this target was staged.\n  const stagedDirs = [\n    join(destRoot, 'prebuilds', `${platform}-${arch}`),\n    join(destRoot, 'build/Release')\n  ]\n  const hasNativeBinary = stagedDirs.some((dir) => {\n    if (!existsSync(dir)) return false\n    return readdirSync(dir, { recursive: true }).some((name) => String(name).endsWith('.node'))\n  })\n\n  if (!hasNativeBinary) {\n    if (platform !== process.platform) {\n      throw new Error(\n        `[stage-native-deps] no prebuilt binary for ${platform}-${arch} and ` +\n          `cannot cross-compile native modules from ${process.platform}-${process.arch}. ` +\n          `Build on the target platform or provide a prebuild.`\n      )\n    }\n    // Same platform, possibly different arch — rebuild from source with\n    // the target architecture so electron-rebuild produces the correct\n    // 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',","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/scripts/stage-native-deps.mjs#L285-L321","documentation":"Error \"[stage-native-deps] no prebuilt binary for ${platform}-${arch} and cannot cross-compile native modules from ${process.platform}-${process.arch}. Build on the target platform or provide a prebuild.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/scripts/stage-native-deps.mjs:303 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the staging step on the target platform, or provide a prebuilt binary for that platform-arch.","Cross-build the native module with an appropriate toolchain before staging."],"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"}