zed-industries/zed · error

Running on unsupported os: {other}

Error message

Running on unsupported os: {other}

What it means

NodeRuntime::install_if_needed maps the host OS onto Node.js dist naming (macos→darwin, linux→linux, windows→win) before downloading a bundled Node. Any other value of std::env::consts::OS (freebsd, openbsd, android, ...) matches the `other` arm and bails immediately — no download is attempted.

Source

Thrown at crates/node_runtime/src/node_runtime.rs:626

    #[cfg(not(windows))]
    const NODE_PATH: &str = "bin/node";
    #[cfg(windows)]
    const NODE_PATH: &str = "node.exe";

    #[cfg(not(windows))]
    const NPM_PATH: &str = "bin/npm";
    #[cfg(windows)]
    const NPM_PATH: &str = "node_modules/npm/bin/npm-cli.js";

    async fn install_if_needed(http: &Arc<dyn HttpClient>) -> Result<Self> {
        log::info!("Node runtime install_if_needed");

        let os = match consts::OS {
            "macos" => "darwin",
            "linux" => "linux",
            "windows" => "win",
            other => bail!("Running on unsupported os: {other}"),
        };

        let arch = match consts::ARCH {
            "x86_64" => "x64",
            "aarch64" => "arm64",
            other => bail!("Running on unsupported architecture: {other}"),
        };

        let version = Self::VERSION;
        let folder_name = format!("node-{version}-{os}-{arch}");
        let node_containing_dir = paths::data_dir().join("node");
        let node_dir = node_containing_dir.join(folder_name);
        let node_binary = node_dir.join(Self::NODE_PATH);
        let npm_file = node_dir.join(Self::NPM_PATH);
        let node_ca_certs = env::var(NODE_CA_CERTS_ENV_VAR).unwrap_or_else(|_| String::new());

        let valid = if fs::metadata(&node_binary).await.is_ok() {
            let result = util::command::new_command(&node_binary)

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Run on macOS, Linux, or Windows where the bundled Node download is supported
  2. If porting, extend the OS match with the correct Node dist triple and archive handling, mirroring the existing arms
  3. Route around the bundled runtime by supplying a system Node runtime instead of the downloading one
Defensive patterns

Strategy: validation

Validate before calling

fn os_supported() -> bool {
    matches!(std::env::consts::OS, "macos" | "linux" | "windows")
}

Type guard

// compile-time gate so unsupported targets fail to build the installer path
#[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))]
compile_error!("bundled node runtime requires macos, linux, or windows");

Try / catch

match NodeRuntime::install_if_needed(&http).await {
    Err(e) if e.to_string().contains("unsupported os") => {
        SystemNodeRuntime::try_from_env().await // or report platform unsupported
    }
    r => r?,
}

Prevention

When it happens

Trigger: Building or running Zed's node_runtime crate on an OS outside {macos, linux, windows}, e.g. a FreeBSD port or an Android build reaching the installer path.

Common situations: Community ports of Zed to BSDs; cross-compilation experiments; CI matrices that include non-tier-1 platforms.

Related errors


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