Yesterday I updated Angular Cli tool and tried to create new project but unfortunately an exception in the terminal window the only result I’ve got. Right now I am using MacOS Mojave version 10.14.5 and Angular Cli version is 8.0.1
The error stack trace:
Workspace needs to be loaded before it is used.
Error: Workspace needs to be loaded before it is used.
at Workspace._assertLoaded (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:108:19)
at Workspace._getTool (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular- devkit/core/src/experimental/workspace/workspace.js:214:14)
at Workspace.getCli (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:196:21)
at NewCommand.getDefaultSchematicCollection (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:266:36)
at NewCommand.parseCollectionName (/usr/local/lib/node_modules/@angular/cli/commands/new-impl.js:41:43)
at NewCommand.initialize (/usr/local/lib/node_modules/@angular/cli/commands/new-impl.js:22:40)
at NewCommand.validateAndRun (/usr/local/lib/node_modules/@angular/cli/models/command.js:127:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
After spending some time to play around with uninstalling/installing npm, node, angular cli, downgrade the version and googling I find this thread Workspace needs to be loaded before it is used · Issue #14591 · angular/angular-cli ,, and my bad I did not read it careful, so kept to waste time with sort of not working solutions.
Finally I pushed myself read each message in that thread I took careful look at my home folder where was .angular-config.json file. This particular file was causing this error (even it was empty).
So, just removed .angular-config.json and ng new myApp got back to work!