Skip to content

fix(@schematics/angular): update @types/node to a version vitest 5 accepts - #34118

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
thekhegay:types-node-vitest5
Sep 18, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
thekhegay:types-node-vitest5

Conversation

@thekhegay

Copy link
Copy Markdown
Contributor

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

ng new --ssr and ng add @angular/ssr on 22.2.0-rc.0 fail while installing:

npx --yes @angular/cli@22.2.0-rc.0 new ssrapp --ssr --skip-git --defaults

npm error code ERESOLVE
npm error Could not resolve dependency:
npm error peerOptional @types/node@"^22.0.0 || >=24.0.0" from vitest@5.0.1
npm error Conflicting peer dependency: @types/node@26.6.1
✖ Package install failed, see above.
The Schematic workflow failed. See above.

The workspace files are written but there is no node_modules. The server schematic adds @types/node from latest-versions, which is still ^20.17.19, while the same schematics now add vitest 5, whose peer range starts at 22. Plain ng new is unaffected, since only the server schematic adds @types/node.

Issue Number: N/A

What is the new behavior?

ng new --ssr installs. ^22.12.0 is the range this repository already uses for its own @types/node, and Node 20 is outside the engines.node range of the generated project anyway.

Does this PR introduce a breaking change?

  • Yes
  • No

…cepts

`ng new --ssr` and `ng add @angular/ssr` fail to install their dependencies:
the server schematic adds `@types/node@^20.17.19`, and vitest 5, which the
same schematics now add, has `@types/node@^22.0.0 || >=24.0.0` as a peer.
npm refuses the tree and the workspace is left without `node_modules`.

`^22.12.0` is what this repository uses for `@types/node` itself, and Node 20
is already outside the `engines.node` range of the generated project.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the @types/node dependency in packages/schematics/angular/utility/latest-versions/package.json from version ^20.17.19 to ^22.12.0. There are no review comments, and I have no feedback to provide.

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Sep 18, 2026
@alan-agius4
alan-agius4 merged commit 1627ccb into angular:main Sep 18, 2026
42 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants