Skip to content

package-lock v3 not working with npmToYarn #99

@drewed

Description

@drewed

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions