{"record":{"id":"ef2476060b83b494","repo":"zed-industries/zed","slug":"failed-to-execute-npm-subcommand-subcommand-std","errorCode":null,"errorMessage":"failed to execute npm {subcommand} subcommand:\nstdout: {:?}\nstderr: {:?}","messagePattern":"failed to execute npm (.+?) subcommand:\nstdout: (.+?)\nstderr: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/node_runtime/src/node_runtime.rs","lineNumber":794,"sourceCode":"            command.envs(npm_command.env);\n            if let Some(directory) = directory {\n                command.current_dir(directory);\n            }\n            command.output().await.map_err(|e| anyhow!(\"{e}\"))\n        };\n\n        let mut output = attempt().await;\n        if output.is_err() {\n            output = attempt().await;\n            anyhow::ensure!(\n                output.is_ok(),\n                \"failed to launch npm subcommand {subcommand} subcommand\\nerr: {:?}\",\n                output.err()\n            );\n        }\n\n        if let Ok(output) = &output {\n            anyhow::ensure!(\n                output.status.success(),\n                \"failed to execute npm {subcommand} subcommand:\\nstdout: {:?}\\nstderr: {:?}\",\n                String::from_utf8_lossy(&output.stdout),\n                String::from_utf8_lossy(&output.stderr)\n            );\n        }\n\n        output.map_err(|e| anyhow!(\"{e}\"))\n    }\n\n    async fn npm_command(\n        &self,\n        prefix_dir: Option<&Path>,\n        proxy: Option<&Url>,\n        subcommand: &str,\n        args: &[&str],\n    ) -> Result<NpmCommand> {\n        let node_binary = self.installation_path.join(Self::NODE_PATH);","sourceCodeStart":776,"sourceCodeEnd":812,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/node_runtime/src/node_runtime.rs#L776-L812","documentation":"Exit-status guard in run_npm_subcommand: the npm subcommand process ran but terminated unsuccessfully; stdout and stderr are embedded for diagnosis. Indicates npm itself failed (network, registry, or argument errors), not a launch failure.","triggerScenarios":"Thrown at crates/node_runtime/src/node_runtime.rs:793 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded stderr for npm's own error message","Check network/proxy access to the npm registry","Retry the subcommand after fixing the underlying npm issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}