You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 inbuildYarnTree()
when it passesundefined
toflattenPackageLock
.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 ofpackageLock.dependencies
in my node_modules, I was able to get thenpmToYarn()
call to work. Perhaps changing it topackageLock.dependencies ?? packageLock.packages
would enable package-lock v3 support without breaking backwards compatibility?The text was updated successfully, but these errors were encountered: