zed-industries/zed · error

{}

Error message

{}

What it means

UnavailableNodeRuntime is the stub NodeRuntimeTrait created when the real Node runtime failed to initialize (download/install failure, unsupported platform). Its binary_path() bails with the stored root-cause error message, so any feature that later asks for the node binary path resurfaces the original failure text verbatim.

Solutions

  1. Read the embedded message — it is the root cause (network, platform, disk); fix that first
  2. Restore network/proxy access to https://nodejs.org and restart Zed to retry the install
  3. Free space / fix permissions under the data dir (~/Library/Application Support/Zed, ~/.local/share/zed) and retry
  4. If the platform is unsupported, supply a system Node and/or run on a supported platform
Defensive patterns

Strategy: try-catch

Validate before calling

// After startup, probe availability cheaply before asking for paths:
fn runtime_available(rt: &dyn NodeRuntimeTrait) -> bool {
    rt.binary_path().is_ok()
}

Try / catch

match runtime.binary_path() {
    Err(err) => {
        // err carries the ORIGINAL init failure; surface that, not a generic message
        show_diagnostic("Node runtime unavailable: {err}");
        offer_retry_of_runtime_install().await;
    }
    Ok(path) => path,
}

Prevention

When it happens

Trigger: The real runtime failed to construct (offline install, nodejs.org unreachable, unsupported OS/arch), and then some component calls binary_path() on the unavailable stub — e.g. an extension or tool requesting the node executable path.

Common situations: First run without network; corporate proxy blocking nodejs.org; disk-full in the data dir during install; afterwards every node-dependent feature (prettier, language servers, extensions) shows this message.

Related errors


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

Appendix: source

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

        }
        None => bail!("npm package {name} declares no executable"),
    };

    Ok(package_directory.join(relative_path))
}

#[derive(Clone)]
pub struct UnavailableNodeRuntime {
    error_message: Arc<String>,
}

#[async_trait::async_trait]
impl NodeRuntimeTrait for UnavailableNodeRuntime {
    fn boxed_clone(&self) -> Box<dyn NodeRuntimeTrait> {
        Box::new(self.clone())
    }
    fn binary_path(&self) -> Result<PathBuf> {
        bail!("{}", self.error_message)
    }

    async fn run_npm_subcommand(
        &self,
        _: Option<&Path>,
        _: Option<&Url>,
        _: &str,
        _: &[&str],
    ) -> anyhow::Result<Output> {
        bail!("{}", self.error_message)
    }

    async fn npm_command(
        &self,
        _: Option<&Path>,
        _proxy: Option<&Url>,
        _subcommand: &str,
        _args: &[&str],

View on GitHub (pinned to 9d272b0363)