Skip to content

CLI: init --install fails on Yarn 2+ because yarn add rejects --ignore-scripts #190

Closed

Description

@FredApps

What went wrong?

DiffCI crashed or printed an error: diffci init --install fails in every Yarn 2+ (Berry) repository.

DiffCI version

0.3.54 (main at 40aa308)

Command you ran

diffci init --install in a repository with "packageManager": "[email protected]" (also with a Berry yarn.lock or a .yarnrc.yml).

Environment

Ubuntu, Node.js 24.22.1, Yarn 4.9.2 through Corepack, terminal.

What happens

installPlan in packages/diffci-cli/src/client/install.ts always runs:

yarn add --dev --exact --ignore-scripts @diffci.com/diffci@<version>

Yarn Classic (1.x) accepts --ignore-scripts, but Yarn 2 and later do not. The exact command against Yarn 4.9.2:

$ yarn add --dev --exact --ignore-scripts [email protected]
Unknown Syntax Error: Unsupported option name ("--ignore-scripts").

$ yarn add [--json] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

So the install step of init --install fails, and DiffCI is not added as a dev dependency.

What you expected

On Yarn 2+, DiffCI is installed with the Berry equivalent, --mode=skip-build, which I checked with the same Yarn 4.9.2 project:

$ yarn add --dev --exact --mode=skip-build [email protected]
➤ YN0000: · Done in 0s 239ms

Yarn Classic keeps --ignore-scripts. The Yarn line can be read from packageManager ([email protected] versus yarn@2+), and without it from a .yarnrc.yml or a Berry lockfile (__metadata:).

Regression test

A new case in packages/diffci-cli/tests/client/install.test.ts in the linked pull request fails on main and passes with the fix.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    bca17fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions