Skip to content

Multiple steps needed to retrieve CLI version #27668

Closed

Description

@medikoo

Command

version

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I've just installed @angular/cli and wanted to check the installed version. Intuitively I stared with ng --version (as such works for most CLI's, node and npm including), and this is what happened:

ng --version
Error: You need to specify a command before moving on. Use '--help' to view the available commands.
medikoo@medikoo-mac first-app-lesson-00 % ng --help   
ng <command>

Commands:
  ng add <collection>            Adds support for an external library to your project.
  ng analytics                   Configures the gathering of Angular CLI usage metrics.
  ng build [project]             Compiles an Angular application or library into an output directory named dist/ at the given output path.                               [aliases: b]
  ng cache                       Configure persistent disk cache and retrieve cache statistics.
  ng completion                  Set up Angular CLI autocompletion for your terminal.
  ng config [json-path] [value]  Retrieves or sets Angular configuration values in the angular.json file for the workspace.
  ng deploy [project]            Invokes the deploy builder for a specified project or for the default project in the workspace.
  ng doc <keyword>               Opens the official Angular documentation (angular.io) in a browser, and searches for a given keyword.                                   [aliases: d]
  ng e2e [project]               Builds and serves an Angular application, then runs end-to-end tests.                                                                   [aliases: e]
  ng extract-i18n [project]      Extracts i18n messages from source code.
  ng generate                    Generates and/or modifies files based on a schematic.                                                                                   [aliases: g]
  ng lint [project]              Runs linting tools on Angular application code in a given project folder.
  ng new [name]                  Creates a new Angular workspace.                                                                                                        [aliases: n]
  ng run <target>                Runs an Architect target with an optional custom builder configuration defined in your project.
  ng serve [project]             Builds and serves your application, rebuilding on file changes.                                                                         [aliases: s]
  ng test [project]              Runs unit tests in a project.                                                                                                           [aliases: t]
  ng update [packages..]         Updates your workspace and its dependencies. See https://update.angular.io/.
  ng version                     Outputs Angular CLI version.                                                                                                            [aliases: v]

Options:
  --help  Shows a help message for this command in the console.                                                                                                             [boolean]

For more information, see https://angular.io/cli/.
medikoo@medikoo-mac first-app-lesson-00 % hg version
zsh: command not found: hg
medikoo@medikoo-mac first-app-lesson-00 % ng version
? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options and autocomplete arguments. 
(Enabling autocompletion will modify configuration files in your home directory.) No
Ok, you won't be prompted again. Should you change your mind, the following command will set up autocompletion for you:

    ng completion
? Would you like to share pseudonymous usage data about this project with the Angular Team
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
details and how to change this setting, see https://angular.io/analytics. Yes

Thank you for sharing pseudonymous usage data. Should you change your mind, the following
command will disable this feature entirely:

    ng analytics disable

Global setting: not set
Local setting: enabled
Effective status: enabled

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.2.3
Node: 20.13.1
Package Manager: npm 10.5.2
OS: darwin arm64

Angular: 17.2.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1702.3
@angular-devkit/build-angular   17.2.3
@angular-devkit/core            17.2.3
@angular-devkit/schematics      17.2.3
@angular/cli                    17.2.3
@schematics/angular             17.2.3
rxjs                            7.8.1
typescript                      4.9.5
zone.js                         0.14.6

It took me 5 interactions to successfully retrieve this information.

If not supporting --version option, I believe the settings questionare should not be forced on ng version command

Minimal Reproduction

ng --version

Exception or Error

No response

Your Environment

Angular CLI: 17.2.3
Node: 20.13.1
Package Manager: npm 10.5.2
OS: darwin arm64

Angular: 17.2.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1702.3
@angular-devkit/build-angular   17.2.3
@angular-devkit/core            17.2.3
@angular-devkit/schematics      17.2.3
@angular/cli                    17.2.3
@schematics/angular             17.2.3
rxjs                            7.8.1
typescript                      4.9.5
zone.js                         0.14.6

Anything else relevant?

No response

Activity

  1. added 10 commits that reference this issue on May 21, 2024
    968631b
    6dd6b87
    a8ffecb
    e7f11f7
    35a0670
    8e6086e
    8899563
    7cab30f
    c5a1a45
    1770e08
  2. added
    freq1: low
    on May 21, 2024
  3. self-assigned this
    on May 21, 2024
  4. added 6 commits that reference this issue on May 21, 2024
    e7f6214
    8085dcc
    e1fb5ef
    5540d5e
    29fba27
    5cd7613
  5. added 4 commits that reference this issue on May 21, 2024
    3619505
    386d766
    f4670fc
    41ab6c8
  6. angular-automatic-lock-bot commented on Jun 21, 2024

    @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.

  7. locked and limited conversation to collaborators on Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/clifreq1: lowseverity2: inconvenienttype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions