Messias Lima
Messias Lima

Reputation: 181

"Workspace needs to be loaded before it is used" on ng new

This code appears to me when I trying to run ng new

sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶ ls
sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶ ng new my-angular-app
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/workspace/workspace.js:69:19)
    at Workspace._getTool (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:175:14)
    at Workspace.getCli (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:157:21)
    at Object.getConfiguredPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/config.js:131:32)
    at Object.getPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/package-manager.js:32:35)
    at NewCommand.createWorkflow (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:156:47)
    at NewCommand.initialize (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:39:14)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶ 

Information about my environment:

Upvotes: 3

Views: 890

Answers (1)

Ronin
Ronin

Reputation: 7970

Seems like the .angular-config.json file in the root directory is causing this issue. After deleting it, the problem was gone:

rm ~/.angular-config.json

See also this issue

Upvotes: 2

Related Questions