Skip to content

fix(angular): pin Angular dependencies to exact versions to fix npm install ERESOLVE - #1878

Merged
ShaneK merged 3 commits into
mainfrom
fix/angular-deps
Jun 12, 2026
Merged

fix(angular): pin Angular dependencies to exact versions to fix npm install ERESOLVE#1878
ShaneK merged 3 commits into
mainfrom
fix/angular-deps

Conversation

@ShaneK

@ShaneK ShaneK commented Jun 12, 2026

Copy link
Copy Markdown
Member

What is the current behavior?

Currently, running ionic start <name> blank --type=angular (or angular-standalone) fails on npm install with an ERESOLVE error. The starters ship without a lockfile, and the Angular base package.json used ^20.0.0 caret ranges for the @angular/* packages. The Angular ecosystem pins its packages to each other exactly (@angular/animations@X requires @angular/core@X and @angular/common@X exactly, @angular/compiler-cli@X requires @angular/compiler@X exactly), so when npm resolves the caret ranges to inconsistent patch versions (e.g. @angular/core@20.1.8 alongside @angular/compiler@20.3.25) the exact peer deps become unsatisfiable. A fresh CI cache happens to resolve everything to the same latest patch and works, which is why this only started showing up on developer machines with older cached metadata.

What is the new behavior?

@angular/*, @angular-eslint/*, and @angular-devkit/build-angular are now pinned to exact versions in both angular/base and angular-standalone/base. Without a lockfile this is the only thing that guarantees npm resolves a single consistent version set, so there's nothing left for the resolver to mix. This matches what ionic-angular (the legacy starter) already does. Loosely-peered packages (@ionic/*, ionicons, eslint, typescript, karma/jasmine) stay on caret ranges since they don't have the exact-peer constraint.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Verified a fresh, no-lockfile npm install + npm run build + npm test. Also confirmed the other current starters install cleanly from a fresh resolution: react-vite and vue-vite (and the legacy react/vue). Only the Angular ecosystem has this exact-peer fragility, so they're the only dirs that needed the change.

Note: pinning means the starters won't pick up new Angular patches until someone bumps them, which is the tradeoff for reliable installs without a lockfile (which this repo intentionally avoids)

@ShaneK
ShaneK requested a review from a team as a code owner June 12, 2026 18:54
@ShaneK
ShaneK requested review from brandyscarney and removed request for a team June 12, 2026 18:54
ShaneK added 2 commits June 12, 2026 12:00
ion-label is a scoped Stencil component whose slotted text is relocated
asynchronously starting in @ionic/angular 8.8.0, so reading textContent
right after a single detectChanges() returns an empty string even though
the text is in the DOM. Awaiting fixture.whenStable() lets slot hydration
finish before the assertion (ROU-10799).

@OS-jacobbell OS-jacobbell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@ShaneK
ShaneK merged commit efdd43b into main Jun 12, 2026
30 checks passed
@ShaneK
ShaneK deleted the fix/angular-deps branch June 12, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants