mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 15:44:36 +00:00
fix(install): handle when bin entry info isn't present in package.json but is in registry (#28822)
Apparently things like the `bin` field can appear in the version info from the registry, but not the package's `package.json`. I'm still not sure how you actually achieve this, but it's the case for `esbuild-wasm`. This fixes the following panic: ``` ❯ deno i --node-modules-dir npm:esbuild-wasm Add npm:esbuild-wasm@0.25.2 Initialize ⣯ [00:00] - esbuild-wasm@0.25.2 ============================================================ Deno has panicked. This is a bug in Deno. Please report this at https://github.com/denoland/deno/issues/new. If you can reliably reproduce this panic, include the reproduction steps and re-run with the RUST_BACKTRACE=1 env var set and include the backtrace in your report. Platform: macos aarch64 Version: 2.2.8+58c6c0b Args: ["deno", "i", "--node-modules-dir", "npm:esbuild-wasm"] View stack trace at: https://panic.deno.com/v2.2.8+58c6c0bc9c1b4ee08645be936ff9268f17028f0f/aarch64-apple-darwin/g4h6Jo393pB4k4kqBo-3kqBg6klqBogtyLg13yLw_t0Lw549Hgj8-Hgw__H428-F4yv_HgjkpKww7gIon4gIw54rKwi5MorzMw5y7G42g7Iw---I40s-I4vu4Jw2rEw8z7Dwnr6J4tp7Bo_vvK thread 'main' panicked at cli/npm/installer/common/bin_entries.rs:108:30: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
This commit is contained in:
parent
ac5c6018a8
commit
ce5b9da11b
14 changed files with 226 additions and 38 deletions
|
@ -1225,7 +1225,15 @@ impl CliOptions {
|
|||
}
|
||||
|
||||
pub fn default_npm_caching_strategy(&self) -> NpmCachingStrategy {
|
||||
if self.flags.unstable_config.npm_lazy_caching {
|
||||
if matches!(
|
||||
self.sub_command(),
|
||||
DenoSubcommand::Install(InstallFlags::Local(
|
||||
InstallFlagsLocal::TopLevel | InstallFlagsLocal::Add(_)
|
||||
)) | DenoSubcommand::Add(_)
|
||||
| DenoSubcommand::Outdated(_)
|
||||
) {
|
||||
NpmCachingStrategy::Manual
|
||||
} else if self.flags.unstable_config.npm_lazy_caching {
|
||||
NpmCachingStrategy::Lazy
|
||||
} else {
|
||||
NpmCachingStrategy::Eager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue