This error only occurs when a package.json is used. It doesn't occur with deno.json.
Steps to reproduce
- Create a
package.json with these contents:
{
"dependencies": {
"foo": "npm:preact-render-to-string@latest"
}
}
- Run
DENO_FUTURE=1 deno install --allow-scripts
Output:
============================================================
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: 1.45.5
Args: ["deno", "install", "--allow-scripts"]
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_semver-0.5.7/src/lib.rs:275:32:
programming error: cannot use matches with a tag: latest
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: deno_semver::VersionReq::matches
3: deno_npm::resolution::snapshot::NpmResolutionSnapshot::resolve_best_package_id
4: deno::npm::managed::resolvers::local::sync_resolution_with_fs::{{closure}}
5: <deno::npm::managed::resolvers::local::LocalNpmPackageResolver as deno::npm::managed::resolvers::common::NpmPackageFsResolver>::cache_packages::{{closure}}
6: deno::npm::managed::ManagedCliNpmResolver::cache_packages::{{closure}}
7: deno::npm::managed::ManagedCliNpmResolver::add_package_reqs_raw::{{closure}}
8: deno::npm::managed::ManagedCliNpmResolver::add_package_reqs::{{closure}}
9: deno::npm::managed::ManagedCliNpmResolver::ensure_top_level_package_json_install::{{closure}}
10: deno::module_loader::load_top_level_deps::{{closure}}
11: deno::spawn_subcommand::{{closure}}
12: <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll
13: tokio::runtime::task::raw::poll
14: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Version: Deno 1.45.5
This error only occurs when a
package.jsonis used. It doesn't occur withdeno.json.Steps to reproduce
package.jsonwith these contents:{ "dependencies": { "foo": "npm:preact-render-to-string@latest" } }DENO_FUTURE=1 deno install --allow-scriptsOutput:
Version: Deno 1.45.5