I am running this command:
C:\Users\Murali\my-first-app>ng g c abcde5 --dry-run -t -s --spec=false
I am receiving the following error:
Unknown option: '--spec'
How can I correct my command to avoid this?
You can find all options here. Answering you question replace --spec=false by --skip-tests. If it won't working please provide the AngularCLI version
With Angular >= 8 you can use:
ng g c component-name --skip-tests --dry-run -s -t
OR
You can edit angular.json to set your global setting to use --skip-tests automatically without having to add it as a flag each time you generate a component with the CLI, by adding the skipTests parameter with value true ie:
{
"projects": {
"<PROJECT_NAME>": {
"schematics": {
"@schematics/angular:component": {
"skipTests": true
}
}
}
}
}
To set this globally run:
ng config schematics.@schematics/angular:component.skipTests true
Then, with this config above you can simply use:
ng g c component-name --dry-run -s -t
See this post for further details. Also, for a list of all available options try:
ng g c --help