angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.72k stars 11.98k forks source link

ng update to 18 RC suggest wrong command to update CLI packages #27660

Closed damyanpetev closed 3 months ago

damyanpetev commented 3 months ago

Command

update

Is this a regression?

The previous version in which this bug was not present was

No response

Description

When updating a current project to Angular 18 RC the ng update command suggest to update @angular/build which is new and not present in the project and consecutively fails if attempted. image

The working command to run is still ng update @angular/cli --next instead, but the suggestion is wrong due to the new group name since @angular/build has been added as first it now shows up as the group name: https://github.com/angular/angular-cli/blob/c79a513a766383a5eac44acfbb8ac3aab10bbfc4/packages/angular/cli/package.json#L45-L47

Not sure what the end goal of the new package is, but assuming the CLI is not going away - perhaps move it back up on to the group so the updates still go though it?

Minimal Reproduction

  1. create a fresh project with ng new
  2. run ng update --next and inspect listed commends
  3. attempt to run ng update @angular/build --next as suggested

First reproduced here https://github.com/IgniteUI/igniteui-angular/pull/14237 but also tested on a completely fresh app so pretty sure it'll repro on any existing project.

Exception or Error

> ng update @angular/build --next
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 18.0.0-rc.2 to perform the update.
✔ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 22 dependencies.
Package '@angular/build' is not a dependency.

Your Environment

Angular CLI: 17.3.7
Node: 20.12.2
Package Manager: npm 10.5.0
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.7
@angular-devkit/build-angular   17.3.7
@angular-devkit/core            17.3.7
@angular-devkit/schematics      17.3.7
@angular/cli                    17.3.7
@schematics/angular             17.3.7
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.6

Anything else relevant?

No response

angular-automatic-lock-bot[bot] commented 2 months ago

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.