build-image icon indicating copy to clipboard operation
build-image copied to clipboard

`yarn-path` configuration property forces needless yarn binary installs

Open JGAntunes opened this issue 3 years ago • 0 comments

Within our build system we rely on yarn --version to detect a mismatch between the default/configured yarn version and what we currently have installed in our build context. Defining a yarn-path in your .yarnrc sets a local yarn binary to execute within the context of that project. This means that the following scenario is possible:

  • Your site has a default pinned version for yarn (e.g. 1.22.10)
  • Your project has a .yarnrc with a yarn-path config property set to a local binary (e.g. version 1.21.1)

In that case, on every build, you'll always be installing a unused yarn version. Example logs:

  • https://app.netlify.com/sites/yarn-rc-test/deploys/60f02e1febce7529d50195da#L28

JGAntunes avatar Jul 15 '21 15:07 JGAntunes