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

package-lock v3 not working with npmToYarn #99

Open
drewed opened this issue Apr 13, 2023 · 0 comments
Open

package-lock v3 not working with npmToYarn #99

drewed opened this issue Apr 13, 2023 · 0 comments

Comments

@drewed
Copy link

drewed commented Apr 13, 2023

Issue description:

I recently updated my npm to v9 and discovered that some functionality built on synp no longer works.

My code calls npmToYarn() which ends up dying in buildYarnTree() when it passes undefined to flattenPackageLock.
After doing some digging, it appears that npm v9 does not populate the dependencies section as it was absent from my package-lock file. Hence the undefined value.

By modifying the line in question to pass packageLock.packages instead of packageLock.dependencies in my node_modules, I was able to get the npmToYarn() call to work. Perhaps changing it to packageLock.dependencies ?? packageLock.packages would enable package-lock v3 support without breaking backwards compatibility?

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

No branches or pull requests

1 participant