zed-industries/zed · error

failed to launch npm subcommand

Error message

failed to launch npm subcommand {subcommand} subcommand
err: {:?}

What it means

Launch failure in run_npm_subcommand: both attempts to spawn and run the npm subcommand failed at the process level (the inner error is embedded), so no output was produced. Usually means the npm/node binary is missing, unusable, or the environment could not be prepared.

Solutions

  1. Verify Zed's managed Node.js installation exists and is executable
  2. Check disk space and permissions on the installation directory
  3. Trigger a re-download/reinstall of the Node runtime
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/node_runtime/src/node_runtime.rs:785 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

        proxy: Option<&Url>,
        subcommand: &str,
        args: &[&str],
    ) -> Result<Output> {
        let attempt = || async {
            let npm_command = self.npm_command(directory, proxy, subcommand, args).await?;
            let mut command = util::command::new_command(npm_command.path);
            command.args(npm_command.args);
            command.envs(npm_command.env);
            if let Some(directory) = directory {
                command.current_dir(directory);
            }
            command.output().await.map_err(|e| anyhow!("{e}"))
        };

        let mut output = attempt().await;
        if output.is_err() {
            output = attempt().await;
            anyhow::ensure!(
                output.is_ok(),
                "failed to launch npm subcommand {subcommand} subcommand\nerr: {:?}",
                output.err()
            );
        }

        if let Ok(output) = &output {
            anyhow::ensure!(
                output.status.success(),
                "failed to execute npm {subcommand} subcommand:\nstdout: {:?}\nstderr: {:?}",
                String::from_utf8_lossy(&output.stdout),
                String::from_utf8_lossy(&output.stderr)
            );
        }

        output.map_err(|e| anyhow!("{e}"))
    }

View on GitHub (pinned to 9d272b0363)