Berry: [Bug] Unable to run yarn `yarn policies set-version` after upgrade to v2

Created on 17 Sep 2019  Â·  9Comments  Â·  Source: yarnpkg/berry

Describe the bug

Running yarn policies under v2 fails with error.

Usage Error: Couldn't find a script named "policies".

To Reproduce

  1. Create new folder
  2. Run yarn init
  3. Run yarn policies set-version v2
  4. Run yarn policies set-version v2 again
    Expected: latest version of v2 is installed
    Actual: Error occurs

Screenshots

If applicable, add screenshots to help explain your problem.

Environment if relevant (please complete the following information):

  • OS: MacOS
  • Node version: 12.10.0
  • Yarn version 2.0.0-rc1
bug stale

Most helpful comment

Whatever command it will be, it should idempotently lead to the same result, whether it's ran on v1 or v2.

All 9 comments

Additionally, running yarn set version 2 gives a different error:

➤ YN0001: Error: No matching release found for range 2.

Expected: latest version of v2 is installed

yarn set version from sources should do that.

This is documented in https://next.yarnpkg.com/getting-started/usage#upgrading-yarn-itself

Why would you expect yarn policies to work with the v2 client?

It was my understanding that it would continue to work, based on this comment:
https://github.com/yarnpkg/berry/issues/350#issuecomment-520244568

Ok so can we keep this in a single issue? As far as I read the issue there's no indication that this is currently supported. Only the intent to support this is expressed.

Whatever works best for you. I created a bug because this used to work and now it doesn't. The other issue is about documentation.

Neither command that used to work is working currently.

Regarding yarn set version from sources: I don't need to be running the "latest from master", just want to stay up to date with the RC.

The alias probably disappeared when I switched our CLI to Clipanion v2 - we should add it back.

Regarding the lack of support for v2, this is because I'm still finalizing the release process and things are still a bit fluctuant. I'm not entirely sure where the release bundle will be downloaded from (still the repository? a release artifact?), so for now I prefer to disable it until I've figured that out. It'll work once out of beta.

Also note that yarn set version berry in the v2 currently has the same behaviour as yarn policies set-version v2 had in the v1 (even in the v1 you could use berry instead of v2, in fact).

Whatever command it will be, it should idempotently lead to the same result, whether it's ran on v1 or v2.

Hi! 👋

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolution faster). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kiprasmel picture kiprasmel  Â·  3Comments

benwainwright picture benwainwright  Â·  3Comments

larixer picture larixer  Â·  4Comments

joshmeads picture joshmeads  Â·  4Comments

GaoxinHuang picture GaoxinHuang  Â·  3Comments