Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing yarn-berry does not seem to work #217

Open
adamretter opened this issue May 29, 2024 · 2 comments
Open

Installing yarn-berry does not seem to work #217

adamretter opened this issue May 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@adamretter
Copy link

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:

jobs:
  clone-and-install:
    docker:
      - image: cimg/node:20.1.0
    resource_class: small
    steps:
      - checkout
      - node/install-packages:
          check-cache: always
          cache-version: v4
          pkg-manager: yarn-berry
          with-cache: false

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):

yarn install v1.22.19
[1/5] Validating package.json...
error @evolvedbinary/lwdita@0.2.4: The engine "yarn" is incompatible with this module. Expected version ">=4.2.2". Got "1.22.19"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exited with code exit status 1

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.

@adamretter adamretter added the bug Something isn't working label May 29, 2024
adamretter added a commit to evolvedbinary/lwdita that referenced this issue May 29, 2024
adamretter added a commit to evolvedbinary/lwdita that referenced this issue May 29, 2024
adamretter added a commit to evolvedbinary/lwdita that referenced this issue May 29, 2024
adamretter added a commit to evolvedbinary/lwdita that referenced this issue May 29, 2024
adamretter pushed a commit to evolvedbinary/prosemirror-lwdita that referenced this issue May 30, 2024
adamretter pushed a commit to evolvedbinary/prosemirror-lwdita that referenced this issue May 30, 2024
@nicklozon
Copy link
Contributor

nicklozon commented Jul 31, 2024

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.

@marboledacci
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants