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 https://github.com/angular/angular-cli/issues/14591, 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!

No responses yet

Leave a Reply

Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Youtube
Consent to display content from Youtube
Vimeo
Consent to display content from Vimeo
Google Maps
Consent to display content from Google