Skip to content

Nest CLI peer range blocks SWC CLI 0.8.x, causing chokidar peer conflict in Angular 21/Nx workspaces #3292

@kav-viasat

Description

@kav-viasat

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Summary
In a workspace using Angular 21 and Nx, npm install fails with ERESOLVE because @swc/cli 0.7.10 expects chokidar ^4.0.1, while Angular tooling resolves chokidar ^5.0.0.
Nest CLI currently declares @swc/cli peer support only through 0.7.x, which prevents using @swc/cli 0.8.x (where chokidar peer is ^5.0.0).

Environment

  • Node: 18.x (also reproducible on 20.x)

  • npm: 10.x

  • @nestjs/cli: 11.0.16

  • @swc/cli: 0.7.10

  • Angular toolchain: 21.2.x

  • Nx: 22.6.0

  • Observed behavior

  • npm install fails with ERESOLVE due to incompatible peer expectations for chokidar:

  • Angular devkit/compiler-cli ecosystem resolves chokidar ^5.0.0

  • @swc/cli 0.7.10 has peerOptional chokidar ^4.0.1
    Representative error lines

While resolving: @swc/cli@0.7.10
Found: chokidar@5.0.0
Could not resolve dependency: peerOptional chokidar ^4.0.1 from @swc/cli@0.7.10
peerOptional @swc/cli "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0" from @nestjs/cli@11.0.16
Expected behavior
Nest CLI should allow an @swc/cli version that is compatible with chokidar 5 so modern Angular/Nx stacks can install without force flags.

Why this matters
This blocks dependency resolution in current Angular 21 projects

Minimum reproduction code

https://nx.dev/docs/getting-started/start-new-project

Steps to reproduce

create a new nx workspace space using Angular 21 and add Nest JS CLI

Expected behavior

Suggested fix
Expand Nest CLI peer range for @swc/cli to include 0.8.x, for example:

from: ^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0
to: ^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0
Additional context

npm view @swc/cli@latest shows 0.8.0 with peerDependencies chokidar ^5.0.0.
This appears to be a peer range lag in Nest CLI rather than a project-local misconfiguration.
Thanks for taking a look.

Package version

11.0.16

NestJS version

No response

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions