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

Draft
wants to merge 1 commit into
base: latest
Choose a base branch
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

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