zed-industries/zed · error
failed to parse npm info response: {e} stdout: {}
Error message
failed to parse npm info response: {e}
stdout: {} What it means
Parse guard in npm_package_latest_version_with_requirement: `npm info --json` ran but its stdout could not be deserialized into NpmInfo, so the latest version cannot be determined. Typically caused by registry errors, proxy interference, or unexpected output.
Source
Thrown at crates/node_runtime/src/node_runtime.rs:286
.run_npm_subcommand(
None,
http.proxy(),
"info",
&[
name,
"--json",
"--fetch-retry-mintimeout",
"2000",
"--fetch-retry-maxtimeout",
"5000",
"--fetch-timeout",
"5000",
],
)
.await?;
let info: NpmInfo = deserialize_npm_info_from_response(&output.stdout).map_err(|e| {
anyhow::anyhow!(
"failed to parse npm info response: {e}\nstdout: {}",
String::from_utf8_lossy(&output.stdout)
)
})?;
let before = npm_config_before(instance.as_ref(), http.proxy())
.await
.context("getting npm before config")
.log_err()
.flatten();
let latest_dist_tag = info.dist_tags.latest.clone();
let selected_version =
select_npm_package_version(name, info, before.as_deref(), version_requirement)?;
log::debug!(
"selected latest npm package version package={name:?} version_requirement={version_requirement:?} before={before:?} dist_tag_latest={latest_dist_tag:?} selected={selected_version}"
);
Ok(selected_version)
}
View on GitHub (pinned to 9d272b0363)
Solutions
- Check network/proxy connectivity to the npm registry
- Retry the package lookup; transient registry responses can be malformed
- Run `npm info <package> --json` manually to inspect the output
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/node_runtime/src/node_runtime.rs:286 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/a0b537fcc9ca6b71.
Report an issue: GitHub.