'Angular CLI command issue: "Unknown option: '--spec'"
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?
Solution 1:[1]
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
Solution 2:[2]
You can also use --skip-tests
flag to skip generating .spec files.
For more detail, you can use ng g c --help
, this will give you further details
Solution 3:[3]
If you are using Angular CLI version 3, replace
--spec=false
with
--skipTests=true
Solution 4:[4]
Instead of
--spec=false
use
--skip-tests
Don't use --skipTests=true
because
Support for camel case arguments has been deprecated and will be removed in a future major version.
Solution 5:[5]
ng g c componentname --skipTests true
In the newer version of Angular CLI --spec is replaced with --skipTests.
This is working at my site.
Solution 6:[6]
Use rather than --sepc false
:
--skip-tests
In the old version of angular, it's was working right but in the new version this not working with me anymore.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Babita Bisht |
Solution 3 | Nikhil Yadav |
Solution 4 | Tiago Martins Peres |
Solution 5 | Anjali |
Solution 6 | Abd Abughazaleh |