Skip to content

Error: Collection "@nestjs/schematics" cannot be resolved. #3471

Description

@radagva

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When trying to create a fresh nestjs project it fails showing this error

Error: Collection "@nestjs/schematics" cannot be resolved.

Failed to execute command: node node "$HOME/Library/pnpm/store/v11/links/@angular-devkit/schematics-cli/19.2.27/328503cc1d656a5a7b6a1584df936ba36c4a16f6043991da97bbe9a24d4106d7/node_modules/@angular-devkit/schematics-cli/bin/schematics.js" @nestjs/schematics:application --name=example --directory=undefined --no-dry-run --no-skip-git --no-strict --package-manager="pnpm" --collection="@nestjs/schematics" --language="ts"

If I run pnpm dlx @nestjs/cli new example it works as expected. This error only happens to me when using the installed CLI.

Minimum reproduction code

This error happens while creating a project with the installed CLI

Steps to reproduce

  1. pnpm --global install @nestjs/cli
  2. nest new example.
  3. select pnpm as package manager to install dependencies.
  4. Error.

Expected behavior

After running nest new example and selecting a package manager to install dependencies it should simply install dependencies

Package version

11.0.23

NestJS version

11.1.27

Node.js version

24.15.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

pnpm version: 11.8.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions