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

Can't find lockfile entry for non semver compliant packages when using yarn #360

Open
MHekert opened this issue Nov 19, 2021 · 0 comments
Open

Comments

@MHekert
Copy link
Contributor

MHekert commented Nov 19, 2021

When trying to add patch for package that has non semver compliant version in its package.json patch generation throws error:

Can't find lockfile entry for ...

For example:
plugin serverless-plugin-aws-alerts has version specified as v1.7.4, while in yarn.lock it's saved as 1.7.4. Because of this entry from yarn.lock is filtered out in following code:

const entries = Object.entries(appLockFile.object).filter(
  ([k, v]) =>
    k.startsWith(packageDetails.name + "@") &&
   v.version === installedVersion,
)

Potential solution that I would like to propose is to coerce versions (semver.coerce) while searching for lockfile entry in yarn.lock.

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