Repository navigation
fix(npm): realpath npm bin main module - #35554
Merged
Merged
Conversation
nathanwhit
marked this pull request as ready for review
June 29, 2026 17:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35551.
This fixes a 2.9.0 regression where a symlinked
node_modules/.binentry was kept as the main module URL when a projectpackage.jsoncaused the path to be treated as npm package space. Relative imports in the bin then resolved fromnode_modules/.bininstead of the real package target.The npm main-module import-map bypass added for #23736 is still preserved, but file URLs in that path are canonicalized before being returned. That restores the realpath behavior for symlinked bin entries without applying the import map to package-internal main modules.
Validation:
cargo build --bin deno./x test-spec run_bin_symlink_realpath_package_json./x test-spec run_bin_with_root_import_map./tools/lint.js