mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
275418473e
Fixes #25998. Fixes https://github.com/denoland/deno/issues/25928. Originally I was just going to make this an error message instead of a panic, but once I got to a minimal repro I felt that this really should work. The panic occurs when you have `nodeModulesDir: manual` (or a package.json present), and you have an npm package with a tag in your deno.json (see the spec test that illustrates this). This code path only actually executes when trying to choose an appropriate package version from `node_modules/.deno`, so we should be able to fix it by storing some extra data at install time. The fix proposed here is to repurpose the `.initialized` file that we store in `node_modules` to store the tags associated with a package. Basically, if you have a version requirement with a tag (e.g. `npm:chalk@latest`), when we set up the node_modules folder for that package, we store the tag (`latest`) in `.initialized`. Then, when doing BYONM resolution, if we have a version requirement with a tag, we read that file and check if the tag is present. The downside is that we do more work when setting up `node_modules`. We _could_ do this only when BYONM is enabled, but that would have the downside of needing to re-run `deno install` when you switch from auto -> manual, though maybe that's not a big deal. |
||
---|---|---|
.. | ||
alias_pkg_json_and_deno_json_jsr_pkg | ||
alias_pkg_json_and_deno_json_npm_pkg | ||
byonm_jsr_npm_dep | ||
byonm_run_tag_after_install | ||
future_install_add_dist_tag | ||
future_install_global | ||
future_install_local_add_deno | ||
future_install_local_add_npm | ||
future_install_local_deno | ||
future_install_node_modules | ||
future_install_node_modules_tag | ||
install_add_dev | ||
install_deprecated_package | ||
install_entrypoint | ||
install_single_http_url_without_global_flag | ||
move_after_install | ||
non_existent_optional_peer | ||
workspace_member_with_tag_dep | ||
workspace_node_modules_not_exists |