Search code examples
angularangular-cli

Cannot Generate any Schematics using Angular CLI generate command


I'm having this problem wherein I'm getting an Option "_name" is not defined. error when running any generate commands ng g <any_schematic>.

I tried doing npm install, using the --project argument but still getting the same results.

I'm using these versions:

Angular version reference


Solution

  • I got it.

    For this specific problem. Reinstall angular cli globally using npm uninstall -g @angular/cli ( use sudo if necessary ) then, do npm cache clean --force

    then reinstall angular cli globally again.

    fixed angular cli that can generate schematics

    Hence, doing a fix for this specific error message requires the usual clean install of the angular-cli itself.