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

yarn@4.0.0-rc.26 is not within ranage for >=1.22.0 #10

Closed
kachkaev opened this issue Oct 23, 2022 · 3 comments · Fixed by #11
Closed

yarn@4.0.0-rc.26 is not within ranage for >=1.22.0 #10

kachkaev opened this issue Oct 23, 2022 · 3 comments · Fixed by #11

Comments

@kachkaev
Copy link

kachkaev commented Oct 23, 2022

Hi @devoto13! 👋 Thanks for this handy plugin! 💯

I just bumped Yarn from v3 to v4 RC using yarn set version canary:

-  "packageManager": "yarn@3.2.0",
+  "packageManager": "yarn@4.0.0-rc.26",
   "engines": {
     "node": "^16.14.0 || ^18.0.0",
     "yarn": ">=1.22.0"
   }

Running yarn install produced this:

➤ YN0000: ┌ Project validation
➤ YN0000: │ The current Yarn version 4.0.0-rc.26 does not satisfy the required version >=1.22.0.
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 3ms

Replacing "yarn": ">=1.22.0" with "yarn": ">=1.22.0 || ^4.0.0-rc" works but I wonder if this is expected behavior. WDYT?

@devoto13
Copy link
Owner

We use the semver package to check version ranges. Looks like this is the reasoning: https://github.com/npm/node-semver#prerelease-tags. It can be controlled by the includePrerelease setting, so should be pretty easy to change, but I'm not really sure if we should 🤔

@kachkaev
Copy link
Author

I see! Feel free to close this issue if you think that the current behavior is correct. I’m happy both ways.

@devoto13
Copy link
Owner

I'll think about this a bit and then post back the final decision :)

devoto13 added a commit that referenced this issue Oct 24, 2022
By default, the `semver` library excludes prerelease check unless explicitly included in the range: https://github.com/npm/node-semver#prerelease-tags. This behavior is handy for the wide range of npm packages where their authors can publish any versions breaking SemVer rules and those version will be picked up by ranges specified by users and installed breaking application. For the purpose of this plugin, we only deal with two mature projects and check that version matches the range specified by the user, but never install/update this version. If the user chose the `>X.Y.Z` constraint, we assume that they know what they are doing and choose less surprising SemVer range checking behavior.

Fixes #10
devoto13 added a commit that referenced this issue Oct 24, 2022
By default, the `semver` library excludes prerelease check unless explicitly included in the range: https://github.com/npm/node-semver#prerelease-tags. This behavior is handy for the wide range of npm packages where their authors can publish any versions breaking SemVer rules and those version will be picked up by ranges specified by users and installed breaking application. For the purpose of this plugin, we only deal with two mature projects and check that version matches the range specified by the user, but never install/update this version. If the user chose the `>X.Y.Z` constraint, we assume that they know what they are doing and choose less surprising SemVer range checking behavior.

Fixes #10
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 a pull request may close this issue.

2 participants