First installed angular CLI globally:
npm install @angular/cli@latest -g
Then I create an angular project outside using by CLI:
ng new hello-world
Copy .angular-cli.json file into the root my project:
Modify .angular-cli.json file: "root" : "src" change to "root" : "ClientApp"
I Installed angularCli dev in my root project: cd MyProject
Then
npm install @angular/cli@latest --save-dev
I Went to that directory :
cd ClientApp/app/components
Then I wrote: ng g c MyComponentName
It has shown me this screen: