Skip to content

Use yarn --frozen-lockfile only for Yarn v1 Classic #1822

Description

@MikeMcC399

What would you like?

Detect Yarn Modern automatically and install dependencies with:

yarn install

instead of using yarn --frozen-lockfile also for Yarn Modern.

Why is this needed?

The installation command for Yarn 1 Classic is yarn --frozen-lockfile. This option is deprecated for Yarn Modern, and provokes the warning:

➤ YN0050: The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead

Yarn 1 Classic is itself frozen and no longer supported. See also #1819 calling for deprecation of support.

Other

yarn install sets

--immutable to true by default in CI

Currently the action documentation Yarn Modern advises using the install-command parameter to install Yarn Modern. This would no longer be necessary if the above proposed enhancement is implemented.

name: example-yarn-modern
on: push
jobs:
  yarn-modern:
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout
        uses: actions/checkout@v7
      - run: corepack enable # (experimental and optional)
      - name: Set up Yarn cache
        uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: yarn
          cache-dependency-path: examples/yarn-modern/yarn.lock
      - name: Cypress run
        uses: cypress-io/github-action@v7
        with:
          working-directory: examples/yarn-modern
          install-command: yarn install

Metadata

Metadata

Assignees

Labels

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions