Skip to content

"The option '--flat' is not registered with the generate command" #3403

@dtgriscom

Description

@dtgriscom

Please provide us with the following information:

OS?

$ cat /proc/version
Linux version 3.13.0-96-generic (buildd@lcy01-09) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #143-Ubuntu SMP Mon Aug 29 20:15:20 UTC 2016

Note: running on Vagrant VM under OS X 10.10.5; directory is shared with host OS

Versions.

$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.18
node: 6.9.1
os: linux x64

Repro steps.

This is an Angular 2 project generated by the CLI, and worked on extensively by me. In the past, the command:

ng generate component myComponent --flat

would generate the files for myComponent without embedding it into a myComponent\ directory. However, today, in the same environment, I got a warning, and the --flat option was ignored:

$ ng generate module --flat utilities
The option '--flat' is not registered with the generate command. Run `ng generate --help` for a list of supported options.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
installing module
  create src/app/utilities/utilities.module.ts
installing component
  create src/app/utilities/utilities.component.css
  create src/app/utilities/utilities.component.html
  create src/app/utilities/utilities.component.spec.ts
  create src/app/utilities/utilities.component.ts

The log given by the failure.

No log was generated.

Mention any other details that might be useful.

Again, I've successfully done this before on this project (I even checked my history). The problem isn't specific to the module name "utilities"; other names give the same results. I've tried restarting the Vagrant VM: no change. Something must have changed or become broken, but I have no clue what.

Interestingly, if I try using ng generate class with the --flat flag, I get the same warning, but the class is NOT put into its own directory:

$ ng generate class --flat anotherClass
The option '--flat' is not registered with the generate command. Run `ng generate --help` for a list of supported options.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
installing class
  create src/app/another-class.ts

Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions