Skip to content

fix: yarn install fails with yarn 1.x after vitest 4.1.0 release #25081

Closed

Description

@maliming

Problem

Since vitest@4.1.0 was published on 2026-03-12, running yarn install with yarn 1.x (without a lockfile) fails:

error Invariant Violation: could not find a copy of vite to link in .../node_modules/vitest/node_modules

vitest@4.1.0 changed its vite dependency from "^6.0.0 || ^7.0.0" (in 4.0.18) to "^6.0.0 || ^7.0.0 || ^8.0.0-0". yarn 1.x cannot handle || version ranges correctly during linking.

Since npm/ng-packs/yarn.lock is in .gitignore, CI has no lockfile and vitest ^4.0.0 always resolves to the latest version.

Fix

Add resolutions to npm/ng-packs/package.json:

"resolutions": {
  "vite": "^7.0.0"
}

Additional issue

npm/ng-packs/package.json has "eslint": "~8.0.0" (resolves to 8.0.1), but @angular-eslint@21.x requires eslint@^8.57.0 || ^9.0.0. This causes ESLint is not a constructor when lint runs. Changed in 9eb6abe6e2 from "^8.0.0" to "~8.0.0" — should be reverted to "^8.57.0".

Activity

  1. changed the title [-]fix: add `resolutions` for `vite` in `npm/ng-packs/package.json` to fix yarn 1.x install failure[/-] [+]fix: multiple issues in `npm/ng-packs/package.json` breaking yarn 1.x install and lint[/+] on Mar 13, 2026
  2. changed the title [-]fix: multiple issues in `npm/ng-packs/package.json` breaking yarn 1.x install and lint[/-] [+]fix: `yarn install` fails with yarn 1.x after vitest 4.1.0 release[/+] on Mar 13, 2026
  3. added this to the 10.1-patch milestone on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions