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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Yarn 2 install confusion #967

Closed
eman1986 opened this issue Feb 19, 2020 · 4 comments
Closed

[Question] Yarn 2 install confusion #967

eman1986 opened this issue Feb 19, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@eman1986
Copy link

eman1986 commented Feb 19, 2020

I hope this is a good spot to ask this, if not feel free to delete this.

I went to see how to install yarn 2 and it says I use yarn 1 to install it 馃槙

I'm mainly confused on why I'd keep an older version of yarn just to install the new version on all my projects (which seems tedious), did yarn 2 switch to be something else? I'm lost on why a package manager would be installed per project instead of being global.

@eman1986 eman1986 added the bug Something isn't working label Feb 19, 2020
@aduh95
Copy link
Contributor

aduh95 commented Feb 19, 2020

I agree with @eman1986, especially on the "seems tedious" part: it seems weird to have to have the 5 MiB JS script of Yarn with the sole purpose of loading another script for Berry. On my Docker build, I ended up writing a shell script to /usr/bin/yarn to minimize the image:

#!/bin/sh
awk '/^yarnPath:/ { print $2 }' .yarnrc.yml | xargs -I '{}' node {} $*

Maybe we could have a yarn-slim which only supports reading local .yarnrc.yml and yarn set version?

I think the reasoning behind having each project use a specific version is explained in the Q&A:

You will want to keep them versioned (this prevents potential issues if, say, two engineers use different Yarn versions with different features).

Arguably that should also be on the Getting started guide since it is a somewhat unexpected behaviour when coming from npm or Yarn 1.

@eman1986
Copy link
Author

eman1986 commented Feb 20, 2020

my concern is that tools like vue cli, angular cli are global tools and you use yarn or npm to install them that way, if yarn 2 is per project that's going to be messy to install global tools like that unless you have yarn 1 (which again is making my brain ache on needing 1 to use the other) or just use npm for those things I suppose.

I think there should have been better explaination on the reasoning on the migration page.

My big question is, will yarn 2 eventually get its own installer or will yarn 1 always seem to exist just to install yarn 2? or will you eventually have us use npm to install yarn 2 once yarn 1 is put out into retirement? I'm assuming yarn 1 is going to eventually be retired.

@arcanis
Copy link
Member

arcanis commented Feb 20, 2020

Related: #766 (comment)

Basically all existing projects expect Yarn 1.x, and even though they should theoretically be compatible with Yarn 2.x, in practice they often require a migration pass that many people won't want to do. As a result, and to avoid breaking setups and lose trust, we prefer to err on the cautious side and assume that projects that don't explicitly ask for a version will use the 1.x.

My big question is, will yarn 2 eventually get its own installer or will yarn 1 always seem to exist just to install yarn 2? or will you eventually have us use npm to install yarn 2 once yarn 1 is put out into retirement? I'm assuming yarn 1 is going to eventually be retired.

Cf the post I linked.

Arguably that should also be on the Getting started guide since it is a somewhat unexpected behaviour when coming from npm or Yarn 1.

Yep, it would be a good idea.

@eman1986
Copy link
Author

That link answered my question, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants