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: file dependency is locked without name #7228

Closed
wants to merge 1 commit into from
Closed

fix: file dependency is locked without name #7228

wants to merge 1 commit into from

Conversation

sonallux
Copy link

This PR currently only contains a reproduction test case for #6430. I have looked into it a bit, but was unable to find a fix for the issue.

It seems like this condition is causing the issue. Because on the first npm install or reify() call the condition is not met because node.packageName and node.name are both equal to @test/a and therefore node.name is not set for the file:a dependency. But on the second npm install or reify() call the condition is met because node.packageName is equal to @test/a and node.name is equal to a. Therefore, the node.name is set to @test/a and the package-lock.json will change.

// we only include name if different from the node path name, and for the
// root to help prevent churn based on the name of the directory the
// project is in
const pname = node.packageName
if (pname && (node === node.root || pname !== node.name)) {
meta.name = pname
}

Can someone help me to fix this issue?

References

Fixes #6430

@sonallux sonallux marked this pull request as ready for review May 15, 2024 20:48
@sonallux sonallux requested a review from a team as a code owner May 15, 2024 20:48
@wraithgar wraithgar marked this pull request as draft May 15, 2024 20:57
@sonallux
Copy link
Author

sonallux commented Jul 3, 2024

Im closing this as the bug has been fixed in #7602

@sonallux sonallux closed this Jul 3, 2024
@sonallux sonallux deleted the chore/6430-add-reproduction-test-case branch July 3, 2024 18:20
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] file: dependency is locked without package name when install is run for the 1st time
1 participant