1

I am trying to generate a component called "hero" using "ng generate component hero" in the cmd line and am getting the following message:

Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

Note: The error was still occurring before the version warning was a problem

What can I do to fix this?

Pang
  • 9,564
  • 146
  • 81
  • 122
DeputyDylDog
  • 200
  • 3
  • 12
  • 1
    Possible duplicate of [Angular CLI ng new error](https://stackoverflow.com/questions/48217313/angular-cli-ng-new-error) – Hugo Noro Jan 12 '18 at 00:51

1 Answers1

1

for an hour was solving the same, eventually concluded:
1. My global and local CLI mismatched (1.6.4 g vs 1.6.3 l), so I ran npm install --save-dev @angular/cli@latest
2. After that that was another warning:
"Error: More than one module matches. Use skip-import option to skip importing the component into the closest module. More than one module matches. Use skip-import option to skip importing the component into the closest module.",
so ng g c my-component --skip-import now works as expected.
I hope it will help.