ng-generate: fails if @schematics/angular is not installed
See original GitHub issueBug, enhancement request, or proposal:
Received error An unhandled exception occurred: Cannot find module '@schematics/angular/utility/ast-utils'
while performing A9 upgrade, "@angular-devkit/schematics": "^9.0.2", "@angular/cli": "9.0.2",
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Angular Nativescript how to fix error on ng g c? - Stack Overflow
I installed it before , when I saw this error. Then error changed from Could not resolve schematics/angular to this what I wrote...
Read more >Schematics for libraries - Angular
With your schematics, your users can use ng add to install an initial version of your library, ng generate to create artifacts defined...
Read more >@schematics/angular | Yarn - Package Manager
ccc8e0350, fix, display actionable error when a style does not exist in Karma builder. 507f756c3, fix, downlevel class private methods when targeting Safari ......
Read more >Configuring an NgRx Feature Module using NgRx Schematics
hi, I am getting this error when I typed "ng generate store ..." : Schematic "store" not found in collection "@schematics/angular". Mark Bell...
Read more >Schematic "page" not found in collection "@schematics/angular".
An unhandled exception occurred: Schematic "pages/test" not found ... You need a schema with ng generate, in case of a component it would...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We no longer import AST utils from
@schematics/angular
, so this should no longer be an issue forng update
. Though, our generate schematics still rely on@schematics/angular
. We could:@schematics/angular
as explicit dependency to the CDK.@schematics/angular
is installed, and print a good error if it’s not installed for some reason.@jelbourn I’d prefer (1) since we need it for
@angular/core
too. For components, going with (2) would be fine too. One concern might be that the package is unnecessarily downloaded in some situations. Though it’s definitely correct to have it as dependency if we directly access it. If we go with (1), we’d most likely still need an dependency on@schematics/angular
too.I created a ticket for working this out long-term: COMP-295. We can defer this until the overall decision is made (and applies for framework too). The ng update issue has been solved, and it’s only a rare issue for
ng generate
now.This is blocked on us figuring out how schematic utilities should be shared across Angular packages.