build-image
build-image copied to clipboard
`yarn-path` configuration property forces needless yarn binary installs
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 ayarn-path
config property set to a local binary (e.g. version1.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