question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng-generate: fails if @schematics/angular is not installed

See original GitHub issue

Bug, 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:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
devversioncommented, Mar 2, 2020

We no longer import AST utils from @schematics/angular, so this should no longer be an issue for ng update. Though, our generate schematics still rely on @schematics/angular. We could:

  1. Spend time figuring out where we can have shared schematic logic.
  2. Add @schematics/angular as explicit dependency to the CDK.
  3. Always assume that @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.

0reactions
devversioncommented, May 25, 2020

This is blocked on us figuring out how schematic utilities should be shared across Angular packages.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found