{"record":{"id":"3a2e09793648d64c","repo":"zed-industries/zed","slug":"github-copilot-native-language-server-binary-was-n","errorCode":null,"errorMessage":"GitHub Copilot native language server binary was not installed","messagePattern":"GitHub Copilot native language server binary was not installed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/copilot/src/copilot.rs","lineNumber":1389,"sourceCode":"        || node_runtime\n            .should_install_npm_package(\n                PACKAGE_NAME,\n                &server_path,\n                paths::copilot_dir(),\n                VersionStrategy::Latest(&latest_version),\n            )\n            .await;\n    if should_install {\n        node_runtime\n            .npm_install_latest_packages(paths::copilot_dir(), &[PACKAGE_NAME])\n            .await?;\n    }\n\n    if fs.is_file(&binary_path).await {\n        return Ok(binary_path);\n    }\n\n    anyhow::bail!(\"GitHub Copilot native language server binary was not installed\")\n}\n\nfn copilot_lsp_native_binary_path() -> anyhow::Result<PathBuf> {\n    let platform = match env::consts::OS {\n        \"linux\" => \"linux\",\n        \"macos\" => \"darwin\",\n        \"windows\" => \"win32\",\n        platform => anyhow::bail!(\"unsupported Copilot language server platform: {platform}\"),\n    };\n    let architecture = match env::consts::ARCH {\n        \"aarch64\" => \"arm64\",\n        \"x86_64\" => \"x64\",\n        architecture => {\n            anyhow::bail!(\"unsupported Copilot language server architecture: {architecture}\")\n        }\n    };\n\n    let package_name = format!(\"copilot-language-server-{platform}-{architecture}\");","sourceCodeStart":1371,"sourceCodeEnd":1407,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/copilot/src/copilot.rs#L1371-L1407","documentation":"Zed installs GitHub Copilot's language server by npm-installing the platform package (@github/copilot-language-server-<os>-<arch>, see the sibling function copilot_lsp_native_binary_path) into paths::copilot_dir(), optionally running npm_install_latest_packages first when an update is warranted, then checks fs.is_file(binary_path). If the expected native binary still does not exist at the computed path after installation, this bail fires — meaning the install ran (or was skipped) but produced nothing at the expected location.","triggerScenarios":"npm install exits 'successfully' but the package layout differs (version bump moved/renamed the binary), npm install silently failed or was skipped (should_install false with a stale cache), the platform/arch package name doesn't match what got installed, or antivirus/quarantine removed the binary after download.","commonSituations":"Upstream @github/copilot-language-server release changed its package structure so the computed binary_path no longer matches; npm cache corruption; disk-full during extraction; a mirror/proxied registry serving an empty or older package; security software deleting the freshly installed executable.","solutions":["Run the reinstall action (Copilot::reinstall) which forces npm_install_latest_packages for PACKAGE_NAME, pulling a fresh consistent package","Delete the copilot directory (paths::copilot_dir) to drop any corrupted/partial cache, then let Zed reinstall","Inspect the installed package layout under the copilot dir and compare the actual binary filename with copilot_lsp_native_binary_path()'s computed path — a mismatch means a version change that needs a Zed update","Check npm registry reachability/permissions (corporate mirrors) and free disk space, then retry"],"exampleFix":"# before: stale partial install\nrm -rf ~/.local/share/zed/copilot  # (paths::copilot_dir())\n# restart editor -> install re-runs but binary_path check keeps failing\n\n# after: force latest package + fresh dir\nrm -rf ~/.local/share/zed/copilot\n# editor: run command 'copilot: reinstall' -> npm_install_latest_packages(PACKAGE_NAME)\n# verify: ls ~/.local/share/zed/copilot/**/copilot-language-server*","handlingStrategy":"retry","validationCode":"// before relying on Copilot, verify the binary actually exists\nlet expected = paths::copilot_dir().join(PACKAGE_NAME)\n    .join(\"copilot-language-server\") // adjust to the real relative path\n    .join(binary_file_name());\nif !std::path::Path::new(&expected).is_file() {\n    trigger_reinstall(); // make install run before the is_file check fails\n}","typeGuard":"fn copilot_binary_present() -> bool {\n    copilot_lsp_native_binary_path()\n        .map(|p| p.is_file())\n        .unwrap_or(false)\n}","tryCatchPattern":"match start_copilot(...).await {\n    Err(err) if err.to_string().contains(\"binary was not installed\") => {\n        // install produced nothing at the expected path — clear and retry once with a forced latest install\n        clear_dir(paths::copilot_dir());\n        force_install_latest(PACKAGE_NAME).await?; // then retry start\n        start_copilot(...).await\n    }\n    other => other,\n}","preventionTips":["Pin/verify npm registry access for @github/copilot-language-server-* in managed environments","After a Copilot package version bump, update Zed so the computed binary path matches the new layout","Watch for antivirus quarantine and disk-full during first install — both leave the dir present but the binary missing"],"tags":["copilot","installation","npm","binary","language-server"],"backgroundTag":"dependency-binary-missing-after-install","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}