Skip to content

fix(install): read extra package info from node_modules and fallback to registry #28893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented Apr 14, 2025

Fixes #28891

We were checking if the node_modules entry for the package was present, but then reading from the global cache.

Instead, read from the package.json in node_modules. As a fallback(which in theory should only really happen if the node_modules dir is somehow messed up), take the more expensive (but likely to work) path of reading from the registry.json.

@nathanwhit nathanwhit requested review from dsherret and Copilot April 14, 2025 18:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • tests/registry/npm/@denotest/extra-info/1.0.0/package.json: Language not supported
  • tests/specs/install/package_extra_nmd/test.jsonc: Language not supported

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nathanwhit nathanwhit enabled auto-merge (squash) April 14, 2025 19:21
@nathanwhit nathanwhit merged commit 9145492 into denoland:main Apr 14, 2025
17 checks passed
@nathanwhit nathanwhit deleted the node-modules-extra branch April 14, 2025 19:34
nathanwhit added a commit that referenced this pull request Apr 14, 2025
…to registry (#28893)

Fixes #28891

We were checking if the node_modules entry for the package was present,
but then reading from the global cache.

Instead, read from the package.json in node_modules. As a fallback(which
in theory should only really happen if the node_modules dir is somehow
messed up), take the more expensive (but likely to work) path of reading
from the registry.json.
nathanwhit added a commit that referenced this pull request Apr 14, 2025
…to registry (#28893)

Fixes #28891

We were checking if the node_modules entry for the package was present,
but then reading from the global cache.

Instead, read from the package.json in node_modules. As a fallback(which
in theory should only really happen if the node_modules dir is somehow
messed up), take the more expensive (but likely to work) path of reading
from the registry.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.2.9 errors saying it can't find a file
2 participants