Skip to content

ng [command] --help does not work outside angular project folder for some commands聽#19057

Closed

Description

@kuncevic

馃悶 Bug report

Command that does not work for in case of global cli marked with an x

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

Is this a regression?

Yes

Description

Help info should be available for any angular-cli related command regardless you inside angular-cli project folder (local cli) or outside angular-cli project folder (global cli)

馃敩 Minimal Reproduction

Navigate outside angular-cli project in console then run any below command:

ng build --help
ng serve --help
ng test --help
ng e2e --help
ng generate --help
ng add --help
ng lint --help
ng xi18n --help
ng run --help

馃敟 Exception or Error

Getting error: /private/var/folders/jj/sjmtmgms0d73pgpp6xqjgq480000gn/T/ng-UIzJTX/angular-errors.log" for further details.
Here is cat angular-errors.log:

[error] Error: Unable to locate a workspace file for workspace path.
    at Object.readWorkspace (/Users/Name/.nvm/versions/node/v12.18.4/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/core.js:75:19)
    at async RunCommand.initialize (/Users/Name/.nvm/versions/node/v12.18.4/lib/node_modules/@angular/cli/models/architect-command.js:31:31)
    at async RunCommand.validateAndRun (/Users/Name/.nvm/versions/node/v12.18.4/lib/node_modules/@angular/cli/models/command.js:124:9)
    at async Object.runCommand (/Users/Name/.nvm/versions/node/v12.18.4/lib/node_modules/@angular/cli/models/command-runner.js:198:24)
    at async default_1 (/Users/Name/.nvm/versions/node/v12.18.4/lib/node_modules/@angular/cli/lib/cli/index.js:59:31)

馃實 Your Environment

Angular CLI: 10.1.4
Node: 12.18.4
OS: darwin x64

Angular: 
... 
Ivy Workspace: 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1001.4 (cli-only)
@angular-devkit/core         10.1.4 (cli-only)
@angular-devkit/schematics   10.1.4 (cli-only)
@schematics/angular          10.1.4 (cli-only)
@schematics/update           0.1001.4 (cli-only)

Also tested with the @next version and got exactly same issue

Angular CLI: 11.0.0-next.6
Node: 12.18.4
OS: darwin x64

Angular: 
... 
Ivy Workspace: 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1100.0-next.6 (cli-only)
@angular-devkit/core         11.0.0-next.6 (cli-only)
@angular-devkit/schematics   11.0.0-next.6 (cli-only)
@schematics/angular          11.0.0-next.6 (cli-only)
@schematics/update           0.1100.0-next.6 (cli-only)

Activity

  1. alan-agius4 commented on Oct 13, 2020

    @alan-agius4
    Collaborator

    Duplicate of #16241

  2. angular-automatic-lock-bot commented on Nov 13, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions