Skip to content

Workspace needs to be loaded before it is used #14591

Closed
@amoncusir

Description

@amoncusir

🐞 Bug report

Command (mark with an x)

- [x] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [x] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Angular CLI only works in my environment until 1.X version.

Description

When try to do any action that not needed be inside of Angular project, even without any argument (like: ng new or ng update), the console throws the message: Workspace needs to be loaded before it is used. This means that I can't create any project or use any tool of Angular 😢.

🔬 Minimal Reproduction

First, install the angular cli (I only can install 7.X or a minor version, below explain that):
$ sudo npm i -g @angular/cli@7.3.9

When the installation finish, I run this command for create a new project:
$ ng new any-project

And the console, output this message: Workspace needs to be loaded before it is used

🔥 Exception or Error


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 new AddCommand (/usr/local/lib/node_modules/@angular/cli/commands/add-impl.js:24:49)
    at Object.runCommand (/usr/local/lib/node_modules/@angular/cli/models/command-runner.js:146:25)
    at async default_1 (/usr/local/lib/node_modules/@angular/cli/lib/cli/index.js:27:31)

🌍 Your Environment


Angular CLI: 7.3.9
Node: 12.3.1
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.13.9
@angular-devkit/core         7.3.9
@angular-devkit/schematics   7.3.9
@schematics/angular          7.3.9
@schematics/update           0.13.9
rxjs                         6.3.3
typescript                   3.2.4

Anything else relevant?

I created other issue, related because can't install the latest version of cli (8.x). This si the issue number: #14584

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions