k.vincent
k.vincent

Reputation: 4143

Angular CLI - error Invalid blueprint: guard

I'am using Angular CLI to generate components, services etc. everything works fine. Just when tying to create a guard it throws the following error:

Invalid blueprint: guard

After a couple of searches, I was not really able to find a helpful solution. The command I'am running following the documentation on GitHub generate guard is:

ng generate guard [name]

Any idea please what could be the reason?

Upvotes: 2

Views: 2056

Answers (1)

Aravind
Aravind

Reputation: 41571

Since you are using 1.0.0-beta.28.3 CLI version, it will not support the guard generation.

Update the Angular CLI

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

Refer Docs for more guidance.

Upvotes: 4

Related Questions