Yarn install failing on GitHub Actions

7.2k views Asked by At

We have a Yarn-based monorepo with the latest Yarn version 3.2.0. We are getting yarn install failures with zero debug logs on our GitHub Workflow:

Run yarn install
➤ YN0000: ┌ Resolution step
Resolution step
➤ YN0000: └ Completed in 1s

➤ YN0000: ┌ Post-resolution validation
Post-resolution validation
➤ YN0000: └ Completed in 0s 226ms
➤ YN0000: Failed with errors in 1s 236ms

This happens when most of our team generates the yarn.lock file, except one team member is able to generate a working yarn.lock that works in the Workflow. The strange part is he is running a very similar setup to most other devs (MBP, Node 16).

Any idea what could be causing this and how we can find out more information?

2

There are 2 answers

2
buildc0de On BEST ANSWER

By default, Yarn will throw an exception on yarn install if it detects that a package doesn't match the checksum stored within the lockfile. To fix:

  1. Open your .yarnrc.yml.
  2. Add the following configuration option:

checksumBehavior: "update"

3
Josh Buchea On

To resolve this issue, upgrade Yarn to version 3.2.4 or later.

Background:

There were a couple of issues in older versions of Yarn 3 that caused the checksum check to fail — upgrading will resolve this issue.