{"record":{"id":"e26ac4cf57338485","repo":"zed-industries/zed","slug":"missing-npm-file","errorCode":null,"errorMessage":"missing npm file","messagePattern":"missing npm file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/node_runtime/src/node_runtime.rs","lineNumber":819,"sourceCode":"\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);\n        let npm_file = self.installation_path.join(Self::NPM_PATH);\n\n        anyhow::ensure!(\n            smol::fs::metadata(&node_binary).await.is_ok(),\n            \"missing node binary file\"\n        );\n        anyhow::ensure!(\n            smol::fs::metadata(&npm_file).await.is_ok(),\n            \"missing npm file\"\n        );\n\n        let command_args = build_npm_command_args(\n            Some(&npm_file),\n            prefix_dir,\n            &self.installation_path.join(\"cache\"),\n            Some(&self.installation_path.join(\"blank_user_npmrc\")),\n            Some(&self.installation_path.join(\"blank_global_npmrc\")),\n            proxy,\n            subcommand,\n            args,\n        );\n        let command_env = npm_command_env(&node_binary);\n\n        Ok(NpmCommand {\n            path: node_binary,","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/node_runtime/src/node_runtime.rs#L801-L837","documentation":"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.","triggerScenarios":"Thrown at crates/node_runtime/src/node_runtime.rs:818 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reinstall/refresh Zed's managed Node runtime so npm is restored","Check that security software did not quarantine the npm file","Verify permissions on the installation directory"],"exampleFix":null,"handlingStrategy":"validation","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"}