{"record":{"id":"bbffc971e7606088","repo":"zed-industries/zed","slug":"running-on-unsupported-os-other-bbffc9","errorCode":null,"errorMessage":"Running on unsupported os: {other}","messagePattern":"Running on unsupported os: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/node_runtime/src/node_runtime.rs","lineNumber":626,"sourceCode":"\n    #[cfg(not(windows))]\n    const NODE_PATH: &str = \"bin/node\";\n    #[cfg(windows)]\n    const NODE_PATH: &str = \"node.exe\";\n\n    #[cfg(not(windows))]\n    const NPM_PATH: &str = \"bin/npm\";\n    #[cfg(windows)]\n    const NPM_PATH: &str = \"node_modules/npm/bin/npm-cli.js\";\n\n    async fn install_if_needed(http: &Arc<dyn HttpClient>) -> Result<Self> {\n        log::info!(\"Node runtime install_if_needed\");\n\n        let os = match consts::OS {\n            \"macos\" => \"darwin\",\n            \"linux\" => \"linux\",\n            \"windows\" => \"win\",\n            other => bail!(\"Running on unsupported os: {other}\"),\n        };\n\n        let arch = match consts::ARCH {\n            \"x86_64\" => \"x64\",\n            \"aarch64\" => \"arm64\",\n            other => bail!(\"Running on unsupported architecture: {other}\"),\n        };\n\n        let version = Self::VERSION;\n        let folder_name = format!(\"node-{version}-{os}-{arch}\");\n        let node_containing_dir = paths::data_dir().join(\"node\");\n        let node_dir = node_containing_dir.join(folder_name);\n        let node_binary = node_dir.join(Self::NODE_PATH);\n        let npm_file = node_dir.join(Self::NPM_PATH);\n        let node_ca_certs = env::var(NODE_CA_CERTS_ENV_VAR).unwrap_or_else(|_| String::new());\n\n        let valid = if fs::metadata(&node_binary).await.is_ok() {\n            let result = util::command::new_command(&node_binary)","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/node_runtime/src/node_runtime.rs#L608-L644","documentation":"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.","triggerScenarios":"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.","commonSituations":"Community ports of Zed to BSDs; cross-compilation experiments; CI matrices that include non-tier-1 platforms.","solutions":["Run on macOS, Linux, or Windows where the bundled Node download is supported","If porting, extend the OS match with the correct Node dist triple and archive handling, mirroring the existing arms","Route around the bundled runtime by supplying a system Node runtime instead of the downloading one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn os_supported() -> bool {\n    matches!(std::env::consts::OS, \"macos\" | \"linux\" | \"windows\")\n}","typeGuard":"// compile-time gate so unsupported targets fail to build the installer path\n#[cfg(not(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\")))]\ncompile_error!(\"bundled node runtime requires macos, linux, or windows\");","tryCatchPattern":"match NodeRuntime::install_if_needed(&http).await {\n    Err(e) if e.to_string().contains(\"unsupported os\") => {\n        SystemNodeRuntime::try_from_env().await // or report platform unsupported\n    }\n    r => r?,\n}","preventionTips":["Gate the bundled-runtime code path behind supported-platform cfgs","Provide a system-node escape hatch on non-tier platforms","Fail loudly at build time on ports instead of at first runtime install"],"tags":["node-runtime","platform","os","install"],"backgroundTag":"unsupported-operating-system","analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}