{"record":{"id":"dfb458f8982769d5","repo":"zed-industries/zed","slug":"node-at-is-too-old-want-got","errorCode":null,"errorMessage":"node at {} is too old. want: {}, got: {}","messagePattern":"node at (.+?) is too old\\. want: (.+?), got: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/node_runtime/src/node_runtime.rs","lineNumber":877,"sourceCode":"impl SystemNodeRuntime {\n    const MIN_VERSION: semver::Version = Version::new(22, 0, 0);\n    async fn new(node: PathBuf, npm: PathBuf) -> Result<Self> {\n        let output = util::command::new_command(&node)\n            .arg(\"--version\")\n            .output()\n            .await\n            .with_context(|| format!(\"running node from {:?}\", node))?;\n        if !output.status.success() {\n            anyhow::bail!(\n                \"failed to run node --version. stdout: {}, stderr: {}\",\n                String::from_utf8_lossy(&output.stdout),\n                String::from_utf8_lossy(&output.stderr),\n            );\n        }\n        let version_str = String::from_utf8_lossy(&output.stdout);\n        let version = semver::Version::parse(version_str.trim().trim_start_matches('v'))?;\n        if version < Self::MIN_VERSION {\n            anyhow::bail!(\n                \"node at {} is too old. want: {}, got: {}\",\n                node.to_string_lossy(),\n                Self::MIN_VERSION,\n                version\n            )\n        }\n\n        let scratch_dir = paths::data_dir().join(\"node\");\n        fs::create_dir(&scratch_dir).await.ok();\n        _ = fs::remove_dir_all(scratch_dir.join(\"cache\")).await;\n        fs::create_dir(scratch_dir.join(\"cache\")).await.ok();\n\n        Ok(Self {\n            node,\n            npm,\n            scratch_dir,\n        })\n    }","sourceCodeStart":859,"sourceCodeEnd":895,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/node_runtime/src/node_runtime.rs#L859-L895","documentation":"After `node --version` succeeds, SystemNodeRuntime parses the version and enforces a floor of 22.0.0. Older system Nodes bail with the wanted and found versions. The check exists because Zed's bundled extensions/tooling require modern Node APIs; the runtime then falls back to using the data-dir layout for caches.","triggerScenarios":"A system node older than v22 (18.x LTS, 20.x, ancient 16.x from distro packages) is picked up when Zed prefers the system runtime.","commonSituations":"Distros shipping node 18/20 as `nodejs`; stale nvm default (`nvm alias default 18`); CI images pinned to node:20; WSL environments with an old apt-installed Node.","solutions":["Upgrade system Node to >=22 (e.g. `nvm install 22 && nvm alias default 22`, or install from nodejs.org)","Prepend the new Node's bin directory to PATH so Zed resolves it first","Or remove/renumber the old node from PATH so Zed's bundled downloaded runtime is used instead"],"exampleFix":"# before\n$ node --version\nv18.20.4\n\n# after\n$ nvm install 22 && nvm alias default 22\n$ node --version\nv22.x.y","handlingStrategy":"validation","validationCode":"fn node_new_enough(version_output: &str) -> bool {\n    version_output\n        .trim()\n        .trim_start_matches('v')\n        .parse::<semver::Version>()\n        .map_or(false, |v| v >= semver::Version::new(22, 0, 0))\n}","typeGuard":"fn meets_min_node_version(v: &semver::Version) -> bool {\n    *v >= semver::Version::new(22, 0, 0)\n}","tryCatchPattern":"if version < SystemNodeRuntime::MIN_VERSION {\n    // report and skip the system runtime; use the bundled one instead\n    return NodeRuntime::install_if_needed(&http).await;\n}","preventionTips":["Keep the default system node >= 22 (set nvm default, update distro package)","CI images: use node:22-or-newer tags where Zed runs","Prefer the bundled runtime in locked-down environments over stale system nodes"],"tags":["node","version","system-runtime","environment"],"backgroundTag":"node-version-too-old","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"}