Closed
Description
Versions
6.0.0
Repro steps
- Open Visual Studio Code to your root Angular project folder.
- Type in ng g component mynewcomponent
Observed behavior
Returns
Workspace needs to be loaded before it is used.
Error: Workspace needs to be loaded before it is used.
at Workspace._assertLoaded (D:\learn\Angular\my-first-app\node_modules\@angular-devkit\core\src\workspace\workspace.js:59:19)
at Workspace.getProjectByPath (D:\learn\Angular\my-first-app\node_modules\@angular-devkit\core\src\workspace\workspace.js:103:14)
at Object.getDefaultSchematicCollection (D:\learn\Angular\my-first-app\node_modules\@angular\cli\utilities\config.js:194:35)
at GenerateCommand.parseSchematicInfo (D:\learn\Angular\my-first-app\node_modules\@angular\cli\commands\generate.js:71:39)
at GenerateCommand.<anonymous> (D:\learn\Angular\my-first-app\node_modules\@angular\cli\commands\generate.js:36:58)
at Generator.next (<anonymous>)
at D:\learn\Angular\my-first-app\node_modules\@angular\cli\commands\generate.js:7:71
at new Promise (<anonymous>)
at __awaiter (D:\learn\Angular\my-first-app\node_modules\@angular\cli\commands\generate.js:3:12)
at GenerateCommand.initialize (D:\learn\Angular\my-first-app\node_modules\@angular\cli\commands\generate.js:30:16)
Desired behavior
Should create a new component.
Created the project using Angular CLI. Tried other projects and getting the same result.