Skip to content

fix(@angular/cli): fallback to local package.json for schematic detection on first run#33285

Draft
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/add-registry-stripped-metadata
Draft

fix(@angular/cli): fallback to local package.json for schematic detection on first run#33285
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/add-registry-stripped-metadata

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Jun 1, 2026

Private package registries frequently strip out custom non-npm metadata properties such as "schematics" or "ng-add" from their remote API responses. This causes ng add to bypass executing schematics on the first run.

This fix adds a fallback check immediately after package installation: if the registry did not report hasSchematics as true, the CLI falls back to resolving and reading the physically installed package's package.json on disk as the single source of truth.

Additionally, if the local manifest specifies ng-add.save: false (but it was persistently installed due to registry omissions), it programmatically prunes the package from dependencies or devDependencies post-execution, and executes a silent packageManager.install() to cleanly remove the physical package files and update the lockfile.

Fixes #33060

…tion on first run

Private package registries frequently strip out
custom non-npm metadata properties such as "schematics" or "ng-add" from
their remote API responses. This causes `ng add` to bypass executing
schematics on the first run.

This fix adds a fallback check immediately after package installation: if
the registry did not report `hasSchematics` as `true`, the CLI falls back
to resolving and reading the physically installed package's `package.json`
on disk as the single source of truth.

Additionally, if the local manifest specifies `ng-add.save: false` (but it
was persistently installed due to registry omissions), it programmatically
prunes the package from `dependencies` or `devDependencies` post-execution,
and executes a silent `packageManager.install()` to cleanly remove the
physical package files and update the lockfile.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng add fails to detect schematics on first run with private package registries

1 participant