diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-06 21:41:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 21:41:19 -0400 |
commit | 5c7f76c570bc099c4e60b38443194c1890808a7f (patch) | |
tree | 99d5ebed160929d6812346f60ec902284e8f83af /cli/resolver.rs | |
parent | 0dca0c5196249c5f947de9ced572967872c0ad6e (diff) |
fix(npm): reload an npm package's dependency's information when version not found (#18622)
This reloads an npm package's dependency's information when a
version/version req/tag is not found.
This PR applies only to dependencies of npm packages. It does NOT yet
cause npm specifiers to have their dependency information cache busted.
That requires a different solution, but this should help cache bust in
more scenarios.
Part of #16901, but doesn't close it yet
Diffstat (limited to 'cli/resolver.rs')
-rw-r--r-- | cli/resolver.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/resolver.rs b/cli/resolver.rs index 5861a758f..46badfe8a 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -237,9 +237,15 @@ impl NpmResolver for CliGraphResolver { if self.no_npm { bail!("npm specifiers were requested; but --no-npm is specified") } - self + match self .npm_resolution .resolve_package_req_as_pending(package_req) + { + Ok(nv) => Ok(nv), + Err(err) => { + bail!("{:#} Try retrieving the latest npm package information by running with --reload", err) + } + } } } |