Skip to content

ng downloads latest stable cli version from npm instead of using same version which is globally installed #18227

@myemuk

Description

@myemuk

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

No, it was happening before.

Description

Command running: ng update. Local ng version was 10.0.1; and version 10.0.2 was installed globally. And global version was latest stable release.

So first, ng chooses local version, because global is newer.
Second: ng decides to download latest stable version from npm to the temporary folder and run it instead of using global version.

As the result it takes much longer time to run this command. Moreover I usually use ng update and than ng update @angular/cli @angular/core if there is an update. So it downloads same version twice instead of using global version.

🔬 Minimal Reproduction

  1. Install latest stable version globally.
  2. Run ng update in any project what needs to be updated.

🔥 Exception or Error


[user@mnjr driver]$ ng update
Your global Angular CLI version (10.0.2) is greater than your local
version (10.0.1). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 50 dependencies.
    We analyzed your package.json, there are some packages to update:
    
      Name                                Version                  Command to update
     ---------------------------------------------------------------------------------
      @angular/cli                        10.0.1 -> 10.0.2         ng update @angular/cli
      @angular/core                       10.0.2 -> 10.0.3         ng update @angular/core
[user@mnjr driver]$ ng update @angular/cli @angular/core
Your global Angular CLI version (10.0.2) is greater than your local
version (10.0.1). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.

🌍 Your Environment


Your global Angular CLI version (10.0.2) is greater than your local
version (10.0.1). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

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

Angular CLI: 10.0.1
Node: 14.5.0
OS: linux x64

Angular: 10.0.2
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: 

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.1
@angular-devkit/build-angular     0.1000.1
@angular-devkit/build-optimizer   0.1000.1
@angular-devkit/build-webpack     0.1000.1
@angular-devkit/core              9.1.10
@angular-devkit/schematics        9.1.10
@angular/cli                      10.0.1
@ngtools/webpack                  10.0.1
@schematics/angular               9.1.10
@schematics/update                0.1000.1
rxjs                              6.6.0
typescript                        3.9.6
webpack                           4.43.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions