Closed adamretter closed 1 month ago
The install command is where you specify what version of yarn you'd like to use, but it doesn't work for yarn-berry since it only references the classic builds.
In order to use yarn-berry I found the best way is to use Corepack. Here's a snippet of my config;
commands:
build:
steps:
- run:
name: Enable Corepack
command: corepack enable
- node/install-packages:
pkg-manager: yarn-berry
I believe yarn will automatically use the version specified by packageManager
in your package.json
. YMMV depending on what node version you're using.
CircleCI should add some documentation for using yarn berry. I think simply using Corepack is the best approach, but would love to know what others do.
This issue should be fixed in the new version https://circleci.com/developer/orbs/orb/circleci/node?version=6.1.0. Note: for yarn-berry to work, the version must be specified in the package.json
Thank you very much @marboledacci
Orb version:
5.2.0
What happened:
I want to use Yarn version 4.2.2 (or thereabouts) and so I have followed the
yarn_berry_zero_install
example from the documentation, and have this config:When this runs I get the following error output in CirceCI (see: https://app.circleci.com/pipelines/github/evolvedbinary/lwdita/473/workflows/ffcd9a7e-e3c1-4504-b11c-29256fee42c6/jobs/1674):
As I have set
pkg-manager: yarn-berry
I don't understand why it is still trying to use Yarn Classic (i.e. 1.x.x).Expected behavior:
It should use version 4.2.2 of Yarn.