-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
dev
detects wrong/both version(s) of yarn
#905
Comments
If you're not making use of a package you can remove it from the environment using e.g |
Yes that works temporarily but there is no way to make it persistent for |
There is, create a dependencies:
[email protected] node@20 [email protected] You can use the names or the pkgx display name e.g |
Yes, what I'm saying is that this only adds packages. The once that are auto-detected are still there and not removed. $ cat pkgx.yaml
dependencies:
[email protected] node@20 [email protected]
$ dev
env +nodejs.org^20 +yarnpkg.com +classic.yarnpkg.com~1.22 +git-scm.org +python.org~3.10 If I remove the |
I believe for other dependencies this problem probably does not occur because (if I remember correctly) if there are multiple versions of one package the version constraints are merged in some way. But because yarn 1.x and yarn >2 have different package names (classic.yarnpkg.com and yarnpkg.com), this merging does not happen. |
@mxcl Do we have something to handle this better already? Assigned from defining dependencies I haven't come across anything else |
likely the solution is |
If we add this it will definitely need to go into the docs that if |
I guess that would also be ok. Although maybe you want to autodetect and use additional packages from pkgx.yml. I think the issue originates here: Lines 76 to 82 in 4787466
If you have both files you get both packages, since they have different names. I don't have good knowledge of all the yarn versions and I don't know what the reasoning for using two different packages names for yarn is and I don't know what the reasoning is to to choose yarn <2 for .yarnrc but yarn >=2 for yarn.lock. But for
If I understand correctly this constraint would then be merged with others and resolve to a single package version. Although that would only work if you move the versions from |
We can't merge the 2 as they are 2 different packages. This is something that has confused many yarn users... even me. And I'm not really sure about the |
I believe .yarnrc is specific to yarn1. their migration guide lists |
But |
yes, in some cases, it will not be correct. the implicit assumption was that most |
@jhheider has the issue of dev pushing |
I don't believe I've seen a PR happen for that yet. |
I'm also hitting this, and another solution is to let pkgx.yml define |
In a project that contains this in
package.json
:and has both
.yarnrc
andyarn.lock
files.(For reference the project where I tried this is: https://github.com/eclipse-theia/theia)
Using
dev
I get the following:It picks up both
+yarnpkg.com
and+classic.yarnpkg.com
.I guess mostly by coincidence
+yarnpkg.com
gets precedence over+classic.yarnpkg.com
which means it uses yarn 4.x instead of yarn 1.x.IMO the correct behavior would be to only detect
+classic.yarnpkg.com
sincepackage.json
specifies yarn version<2
.Somewhat related: Is there a way to turn off an automatically detected package from e.g.
pkgx.yaml
?The text was updated successfully, but these errors were encountered: