I was receiving the following error when I tried to run the following command on the CLI:
ng generate component [component-name]
I kept getting:
Cannot read property 'sourceRoot' of undefined
I am guessing I started getting it after updating the version of angular I was on.
See reply for solution.
To fix the issue I had to go to my Angular.json folder.
Once updated I was able to run the command
ng generate component [component-name]
No issues came up