Skip to content

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

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".

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions