zed-industries/zed · error

GitHub Copilot native language server binary was not…

Error message

GitHub Copilot native language server binary was not installed

What it means

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.

Solutions

  1. Run the reinstall action (Copilot::reinstall) which forces npm_install_latest_packages for PACKAGE_NAME, pulling a fresh consistent package
  2. Delete the copilot directory (paths::copilot_dir) to drop any corrupted/partial cache, then let Zed reinstall
  3. 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
  4. Check npm registry reachability/permissions (corporate mirrors) and free disk space, then retry

Example fix

# before: stale partial install
rm -rf ~/.local/share/zed/copilot  # (paths::copilot_dir())
# restart editor -> install re-runs but binary_path check keeps failing

# after: force latest package + fresh dir
rm -rf ~/.local/share/zed/copilot
# editor: run command 'copilot: reinstall' -> npm_install_latest_packages(PACKAGE_NAME)
# verify: ls ~/.local/share/zed/copilot/**/copilot-language-server*
Defensive patterns

Strategy: retry

Validate before calling

// before relying on Copilot, verify the binary actually exists
let expected = paths::copilot_dir().join(PACKAGE_NAME)
    .join("copilot-language-server") // adjust to the real relative path
    .join(binary_file_name());
if !std::path::Path::new(&expected).is_file() {
    trigger_reinstall(); // make install run before the is_file check fails
}

Type guard

fn copilot_binary_present() -> bool {
    copilot_lsp_native_binary_path()
        .map(|p| p.is_file())
        .unwrap_or(false)
}

Try / catch

match start_copilot(...).await {
    Err(err) if err.to_string().contains("binary was not installed") => {
        // install produced nothing at the expected path — clear and retry once with a forced latest install
        clear_dir(paths::copilot_dir());
        force_install_latest(PACKAGE_NAME).await?; // then retry start
        start_copilot(...).await
    }
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/3a2e09793648d64c. Report an issue: GitHub.

Appendix: source

Thrown at crates/copilot/src/copilot.rs:1389

        || node_runtime
            .should_install_npm_package(
                PACKAGE_NAME,
                &server_path,
                paths::copilot_dir(),
                VersionStrategy::Latest(&latest_version),
            )
            .await;
    if should_install {
        node_runtime
            .npm_install_latest_packages(paths::copilot_dir(), &[PACKAGE_NAME])
            .await?;
    }

    if fs.is_file(&binary_path).await {
        return Ok(binary_path);
    }

    anyhow::bail!("GitHub Copilot native language server binary was not installed")
}

fn copilot_lsp_native_binary_path() -> anyhow::Result<PathBuf> {
    let platform = match env::consts::OS {
        "linux" => "linux",
        "macos" => "darwin",
        "windows" => "win32",
        platform => anyhow::bail!("unsupported Copilot language server platform: {platform}"),
    };
    let architecture = match env::consts::ARCH {
        "aarch64" => "arm64",
        "x86_64" => "x64",
        architecture => {
            anyhow::bail!("unsupported Copilot language server architecture: {architecture}")
        }
    };

    let package_name = format!("copilot-language-server-{platform}-{architecture}");

View on GitHub (pinned to f4178619ac)