Skip to content
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

fix(arborist): condition to include name field in package-lock fixed #7602

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

milaninfy
Copy link
Contributor

@milaninfy milaninfy commented Jun 19, 2024

When metadata is committed for the first time when there is no package-lock, when target node has the same name field value as target package name and link node also share the same name field, name field is omitted from lock file, in subsequent times when there is already a lock file, it reads target node with name field derived from realpath value of the node and included in lock file. this creates mismatch of lock file between installs.

This PR adds additional condition to check if name derived from realpath is the same name as package and adds the name property.

Fixes: #7166

@milaninfy milaninfy force-pushed the mm/mismatch-lockfile-after-install branch from 1015633 to e2fdc79 Compare June 26, 2024 16:14
@milaninfy milaninfy changed the title fix(arborist): name field mismatch in lockfile due to local dep link fix(arborist): condition to include name field in package-lock fixed Jun 26, 2024
@milaninfy milaninfy force-pushed the mm/mismatch-lockfile-after-install branch from e2fdc79 to de44240 Compare June 26, 2024 18:32
@milaninfy milaninfy marked this pull request as ready for review June 26, 2024 18:37
@milaninfy milaninfy requested a review from a team as a code owner June 26, 2024 18:37
@wraithgar wraithgar merged commit a8e666e into npm:latest Jun 27, 2024
23 checks passed
@github-actions github-actions bot mentioned this pull request Jun 27, 2024
@milaninfy milaninfy deleted the mm/mismatch-lockfile-after-install branch August 26, 2024 19:25
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.

[BUG] When reinstalling, the package-lock.json is updated (local packages)
2 participants