Home > other >  When running ng generate class customer -type=model, receiving an error "Unknown Option: '
When running ng generate class customer -type=model, receiving an error "Unknown Option: '

Time:02-05

Trying to deploy a simple MEAN stack application according to this page

I am using a Centos 8 OS. I have posted my system's environment in detail below.

When running the following command:

ng generate class customer –type=model

being gifted with the below error:

[root@localhost src]# ng generate class customer -type=model
Unknown option: '-e'

Did try digging across the web, nothing was spot on for this error, or I missed the spot. I have posted the environment in detail as below. Any assistance is much appreciated.

[root@localhost src]# node -v
v16.13.1
[root@localhost src]# npm -v
8.1.2
[root@localhost src]# ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 13.2.2
Node: 16.13.1
Package Manager: npm 8.1.2
OS: linux x64

Angular: 13.2.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1302.2
@angular-devkit/build-angular   13.2.2
@angular-devkit/core            13.2.2
@angular-devkit/schematics      13.2.2 (cli-only)
@schematics/angular             13.2.2 (cli-only)
rxjs                            7.5.2
typescript                      4.5.5

CodePudding user response:

You need to use -- and not - while specifying the option. So the proper way to generate class with type option would be:

ng generate class customer --type=model

or

ng g class customer --type=model

Reference: class schematic command

  •  Tags:  
  • Related