angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng update says it checked package.json but it seems that can be misleading

Open sixcorners opened this issue 2 years ago • 0 comments

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

no

Description

ng update says that it checked package.json but if you take an old project, update the dependencies, npm install, then go back to the old package.json versions it will say that all the versions are fine. It seems to be checking the installed modules before it checks package.json.

Either the command should be fixed to just check package.json or the message should be updated to say what it is actually checking.

🔬 Minimal Reproduction

install new dependencies into node_modules set it off to the side have a package.json with old dependencies

$ npx @angular/cli update
Using package manager: 'npm'
Collecting installed dependencies...
Found 0 dependencies.
    We analyzed your package.json, there are some packages to update:
    
      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cdk                       12.2.13 -> 13.3.6        ng update @angular/cdk
      @angular/cli                       12.1.4 -> 13.3.5         ng update @angular/cli
      @angular/core                      12.1.5 -> 13.3.6         ng update @angular/core
      @angular/material                  12.2.13 -> 13.3.6        ng update @angular/material
    
    There might be additional packages which don't provide 'ng update' capabilities that are outdated.
    You can update the additional packages by running the update command of your package manager.
$ mv node_modules2/ node_modules/
$ npx @angular/cli update
Using package manager: 'npm'
Collecting installed dependencies...
Found 28 dependencies.
    We analyzed your package.json and everything seems to be in order. Good work!

🔥 Exception or Error





🌍 Your Environment



$ npx @angular/cli version

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

Angular CLI: 13.3.5
Node: 16.15.0
Package Manager: npm 
OS: linux x64

Angular: 13.3.6
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.5
@angular-devkit/build-angular   13.3.5
@angular-devkit/core            13.3.5
@angular-devkit/schematics      13.3.5
@angular/cli                    13.3.5
@schematics/angular             13.3.5
rxjs                            7.5.5
typescript                      4.6.4

Anything else relevant?

sixcorners avatar May 08 '22 11:05 sixcorners