{"record":{"id":"28491609d1354622","repo":"NousResearch/hermes-agent","slug":"stage-native-deps-native-binary-platform-mismatc","errorCode":null,"errorMessage":"[stage-native-deps] native binary platform mismatch (target=${targetPlatform}):\n  ${m.file}: expected ${m.expected}, got ${m.classified ?? 'unknown'}\nRefusing to stage a binary compiled for the wrong platform.","messagePattern":"\\[stage-native-deps\\] native binary platform mismatch \\(target=(.+?)\\):\n  (.+?): expected (.+?), got (.+?)\nRefusing to stage a binary compiled for the wrong platform\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/scripts/stage-native-deps.mjs","lineNumber":212,"sourceCode":"  function scan(dir, relPrefix) {\n    if (!existsSync(dir)) return\n    for (const entry of readdirSync(dir, { withFileTypes: true })) {\n      if (entry.isDirectory()) {\n        scan(join(dir, entry.name), `${relPrefix}${entry.name}/`)\n        continue\n      }\n      if (!entry.name.endsWith('.node')) continue\n      const fullPath = join(dir, entry.name)\n      const classified = classifyNativeBinary(fullPath)\n      if (classified !== targetPlatform) {\n        mismatches.push({ file: `${relPrefix}${entry.name}`, classified, expected: targetPlatform })\n      }\n    }\n  }\n  scan(join(destRoot, 'prebuilds'), 'prebuilds/')\n  scan(join(destRoot, 'build', 'Release'), 'build/Release/')\n  if (mismatches.length > 0) {\n    throw new Error(\n      `[stage-native-deps] native binary platform mismatch (target=${targetPlatform}):\\n` +\n        mismatches\n          .map((m) => `  ${m.file}: expected ${m.expected}, got ${m.classified ?? 'unknown'}`)\n          .join('\\n') +\n        `\\nRefusing to stage a binary compiled for the wrong platform.`\n    )\n  }\n}\n\n/**\n * Stage node-pty's native runtime dependencies into `destRoot`.\n *\n * Exported separately from `stageNodePty` so tests can supply a fake\n * node-pty source tree without going through real module resolution.\n *\n * Strategy (fail-closed):\n *\n * 1. Copy the matching prebuild (`prebuilds/<platform>-<arch>/`) if present.","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/scripts/stage-native-deps.mjs#L194-L230","documentation":"Error \"[stage-native-deps] native binary platform mismatch (target=${targetPlatform}):\n  ${m.file}: expected ${m.expected}, got ${m.classified ?? 'unknown'}\nRefusing to stage a binary compiled for the wrong platform.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/scripts/stage-native-deps.mjs:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stage a binary built for the target platform (run on that platform or use a matching prebuild).","Check the target platform argument matches the prebuilt binary you downloaded."],"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-15T17:31:12.345Z"}