question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug?]: `yarn version <version>` doesn't work when the version jump isn't major/minor/patch/prerelease/decline

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

See title and the reproduction below.

Originally reported by @vefydwy in #3278.

To reproduce

await packageJsonAndInstall({
  version: `0.0.0`,
});

await expect(yarn(`version`, `2.0.0`))
  .resolves.toBeTruthy();

Environment

  System:
    OS: Linux 5.13 Arch Linux
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
  Binaries:
    Node: 16.0.0 - /tmp/xfs-049440fa/node
    Yarn: 3.0.1.dev - /tmp/xfs-049440fa/yarn
    npm: 7.10.0 - ~/.nvm/versions/node/v16.0.0/bin/npm

Additional context

Broken by https://github.com/yarnpkg/berry/pull/3158.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arcaniscommented, Sep 29, 2021
  • set version latest downloads the latest stable >2 if the current release you use is already >2, otherwise the latest 1.x (in other words it doesn’t silently upgrade past 1.x, for backward compatibility)

  • set version berry always downloads the latest stable version >2 (including by upgrading to higher majors)

  • set version canary (new in 3.0) always downloads the latest release candidate.

The difference between stable and rc is very small - it’s almost more a marketing difference than functional one, as all the tests need to pass whether it’s one or the other. At Datadog we even use builds built straight from sources, for example.

1reaction
merceyzcommented, Sep 14, 2021

It’s available in the latest canary builds

yarn set version canary && yarn plugin import version
Read more comments on GitHub >

github_iconTop Results From Across the Web

`yarn version` doesn't accept `premajor`, `preminor`, `prepatch ...
Self-service I'd be willing to implement a fix Describe the bug According to the inline help: $ yarn version --help .
Read more >
`yarn set version` | Yarn - Package Manager
This command will download a specific release of Yarn directly from the Yarn GitHub repository, will store it inside your project, and will...
Read more >
Why Running `yarn upgrade` Does Not Update My `package ...
I faced a bug because of the old dependencies. Tried yarn upgrade , never get it to work. I finally upgraded all my...
Read more >
How do I change the version of yarn used? - Stack Overflow
I ran brew upgrade yarn to get the latest version, which is 0.24.6 . After Homebrew successfully upgrades yarn , I run yarn...
Read more >
How To Install and Use the Yarn Package Manager for Node.js
If you see a version number, such as v12.16.3 printed, you have Node.js installed. If you get a command not found error (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found