{"record":{"id":"70984ed228f09303","repo":"NousResearch/hermes-agent","slug":"rebuilding-the-desktop-app-failed-exit-the","errorCode":null,"errorMessage":"Rebuilding the desktop app failed (exit {:?}). The update was applied but the app could not be rebuilt; run `hermes desktop` from a terminal to see the error.","messagePattern":"Rebuilding the desktop app failed \\(exit (.+?)\\)\\. The update was applied but the app could not be rebuilt; run `hermes desktop` from a terminal to see the error\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/bootstrap-installer/src-tauri/src/update.rs","lineNumber":548,"sourceCode":"             applied but the app could not be rebuilt; run `hermes desktop` \\\n             from a terminal to see the error.\",\n            rebuild.exit_code\n        );\n        emit_stage(\n            &app,\n            \"rebuild\",\n            StageState::Failed,\n            Some(rebuild_ms),\n            Some(msg.clone()),\n        );\n        emit(\n            &app,\n            BootstrapEvent::Failed {\n                stage: Some(\"rebuild\".into()),\n                error: msg.clone(),\n            },\n        );\n        return Err(anyhow!(msg));\n    }\n    emit_stage(&app, \"rebuild\", StageState::Succeeded, Some(rebuild_ms), None);\n\n    let launch_target = if let Some(target_app) = target_app {\n        let started = Instant::now();\n        emit_stage(&app, \"install\", StageState::Running, None, None);\n        match install_macos_app_update(&app, &install_root, &target_app).await {\n            Ok(installed_app) => {\n                emit_stage(\n                    &app,\n                    \"install\",\n                    StageState::Succeeded,\n                    Some(started.elapsed().as_millis() as u64),\n                    None,\n                );\n                Some(installed_app)\n            }\n            Err(err) => {","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/bootstrap-installer/src-tauri/src/update.rs#L530-L566","documentation":"Stage-3 failure of the update flow: `hermes desktop --build-only` (the rebuild that `hermes update` deliberately skips) exited non-zero. The state is deliberately partial — the update itself was applied, but the desktop app binary could not be rebuilt, so the user is pointed at running `hermes desktop` from a terminal to see the real build error.","triggerScenarios":"Node/npm toolchain failures during the Electron/React build (missing node_modules, npm registry errors, out-of-memory), Rust/Tauri build failures, disk-full during bundling, or native module compilation errors after an OS/Xcode/MSVC toolchain update.","commonSituations":"Upgraded macOS without updating Xcode CLT so node-gyp fails; npm proxy blocking registry.npmjs.org; a dev machine low on RAM where esbuild/electron-builder OOM; node_modules in a half-installed state from an interrupted earlier build.","solutions":["Run `hermes desktop` from a terminal and read the first actual error in the build output.","If it is a dependency/toolchain issue: update Xcode CLT / MSVC / Node, then retry the rebuild.","Clean the build state (remove apps/desktop node_modules / release dir) and rebuild.","Free disk space and memory; electron builds need several GB."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Before the rebuild step, check the toolchain is present.\nfn desktop_build_prereqs_ok() -> bool {\n    [\"node\", \"npm\"].iter().all(|tool| {\n        std::process::Command::new(tool).arg(\"--version\").output().is_ok_and(|o| o.status.success())\n    })\n}\n\nif !desktop_build_prereqs_ok() {\n    eprintln!(\"node/npm missing — the desktop rebuild will fail. Install Node first.\");\n}","typeGuard":null,"tryCatchPattern":"// The update itself succeeded — degrade gracefully, tell the user exactly what to do next.\nif rebuild.exit_code != Some(0) {\n    emit_stage(&app, \"rebuild\", StageState::Failed, Some(ms),\n        Some(\"Update applied but the desktop app could not be rebuilt; run `hermes desktop` from a terminal to see the error.\".into()));\n    // Do NOT roll back the applied update; offer manual rebuild instead.\n}","preventionTips":["Keep Node/npm and the native toolchain (Xcode CLT / MSVC) current and installed before updating.","Free several GB of disk and RAM before updates that rebuild the desktop app.","Run `hermes desktop --build-only` manually after toolchain upgrades to confirm the build works."],"tags":["build","desktop","update","bootstrap-installer"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}