zed-industries/zed · error

missing npm file

Error message

missing npm file

What it means

Guard in NodeRuntime::npm_command: the npm script is missing at installation_path/NPM_PATH even though the node binary check passed. The managed Node runtime installation is partially corrupt or incomplete.

Source

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

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

    async fn npm_command(
        &self,
        prefix_dir: Option<&Path>,
        proxy: Option<&Url>,
        subcommand: &str,
        args: &[&str],
    ) -> Result<NpmCommand> {
        let node_binary = self.installation_path.join(Self::NODE_PATH);
        let npm_file = self.installation_path.join(Self::NPM_PATH);

        anyhow::ensure!(
            smol::fs::metadata(&node_binary).await.is_ok(),
            "missing node binary file"
        );
        anyhow::ensure!(
            smol::fs::metadata(&npm_file).await.is_ok(),
            "missing npm file"
        );

        let command_args = build_npm_command_args(
            Some(&npm_file),
            prefix_dir,
            &self.installation_path.join("cache"),
            Some(&self.installation_path.join("blank_user_npmrc")),
            Some(&self.installation_path.join("blank_global_npmrc")),
            proxy,
            subcommand,
            args,
        );
        let command_env = npm_command_env(&node_binary);

        Ok(NpmCommand {
            path: node_binary,

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Reinstall/refresh Zed's managed Node runtime so npm is restored
  2. Check that security software did not quarantine the npm file
  3. Verify permissions on the installation directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/node_runtime/src/node_runtime.rs:818 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/e26ac4cf57338485. Report an issue: GitHub.