Skip to content

Yarn version differences between distros #3200

@meisterT

Description

@meisterT

We are using Yarn for frontend deps now. Ubuntu LTS comes with Yarn 1.x, while debian stable comes with Yarn 4.x. Yarn changed the lockfile format between version 1 and 2, so any time you run yarn install on debian, it will change the lockfile format, showing up in git diff and potentially being added to PRs where it would break other people who are stuck with older versions of Yarn.

Adding --immutable or --frozen-lockfile doesn't help, as Yarn fails then with something like:

... lots of output ...
➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
➤ YN0000: └ Completed
➤ YN0000: · Failed with errors in 0s 265ms

Let's think about how to best resolve this:

  • Add the file to .gitignore. Then you would need to do git add -f webapp/yarn.lock on actual desired changes, and you would have to do this on a machine where Yarn 1.x is available.
  • Force debian users to somehow downgrade their Yarn version, e.g. by adding some apt sources that allow it or use npm to install it.
  • Force Ubuntu users to somehow upgrade their Yarn version, by using similar mechanisms than debian users would need to use for the downgrade.
  • Any other options?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions