at the time I'm going to create component using ng g component command I facing with this error what I need to do to solve this.
"The generate command requires to be run in an Angular project, but a project definition could not be found."
You can also get this behavior if you are confusing ng new with ng g application .
After ng new project make sure you entered project directory in terminal.
Your project folder must either contain angular.json
or angular-cli.json
.
The above mentioned file contains your project definition and its structure. So, that's why without these files and without angular-cli
installed. You won't be able to run,
ng g component
command successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With