Error executing the ng generate component command

0

I updated my angular project 4 to 5 and everything works fine. But when I execute the ng generate component nameComponent command it throws me this error

Schematic input does not validate against the Schema: {"path":"/src/app/...","prefix":"app","styleext":["css","scss"],"inlineStyle":false,"inlineTemplate":false,"changeDetection":"
Default","spec":true,"flat":false,"skipImport":false,"export":false,"entryComponent":false}
Errors:

  Data path ".styleext" should be string.

However the other commands for example to generate class, services, etc. They work well for me. Why is this happening to me?

    
asked by Richard Urquiza Santiesteban 29.08.2018 в 18:26
source

1 answer

0

The cause of the error is because my file angular.json specified the following:

"schematics": {
    "@schematics/angular:component": {
      "prefix": "app",
      "styleext":["css",
       "scss"
       ]
    },
    "@schematics/angular:directive": {
      "prefix": "app"
    }
  }

by changing it for this

"schematics": {
    "@schematics/angular:component": {
      "prefix": "app",
      "styleext":"css"
    },
    "@schematics/angular:directive": {
      "prefix": "app"
    }
  }

everything works fine. It also works if I do not specify the schematics to the project:

"schematics": {}
    
answered by 29.08.2018 в 19:26