Skip to content

Useless installation of temporary CLI #24024

Closed

Description

@egonknapen

Command

update

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'm not sure if this should be a bug or a feature, it's more of an annoyance.

Every week when I check with 'ng update' it first complains that the CLI is outdated and starts installing a temporary CLI version, which takes a while. Then it tells me there is a new CLI version and I have to install it again with 'ng update @angular/cli', this time for real. Next time I do a 'ng update' it quickly shows me, without the delay.

Is it really necessary to install a new temporary cli version every week ?

Or maybe if there is a new one, can't we have question or a parameter to install the new CLI version (automatically), instead of installing it temporarily (and thus twice)? Just like when you type 'ng new' you also get a question.

Minimal Reproduction

ng update

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 14.2.5 to perform the update.
√ Packages successfully installed.

Exception or Error

No response

Your Environment

Angular CLI: 14.2.5
Node: 16.16.0
Package Manager: npm 8.3.0
OS: win32 x64

Anything else relevant?

No response

Activity

  1. alan-agius4 commented on Oct 6, 2022

    @alan-agius4
    Collaborator

    Primarily ng update is needed to update to a new major version as this is typically when code migrations are added. For minor and patch updates, updating the dependencies in the package.json or refreshing the lock file will suffice.

    The temporary CLI is installed when an outdated version is used to perform the update. The latest version is always used as the update runner. This is extremely important when there are fixes and features that target the update process, as otherwise during the update the old version with potential bugs is used which might cause updates to fail. As such downloading the temporary version is definitely the better DX.

  2. egonknapen commented on Oct 6, 2022

    @egonknapen
    Author

    Which means that a batch file doing:

    ng update @angular/cli
    ng update

    Would be the faster way to weekly check for updates of your system...

    That CLI system is outdated every week.

  3. alan-agius4 commented on Oct 6, 2022

    @alan-agius4
    Collaborator

    I strongly belief that developers should not perform dependency updates themselves (At least for non major versions).

    There are a number of excellent tools that automate this, like RenovateBot which can also be self hosted and thus ideal for corp environments and DependaBot.

  4. alan-agius4 commented on Oct 6, 2022

    @alan-agius4
    Collaborator

    Following a convo with @clydin we decided that we will disable downloading a temporary version of the Angular CLI when running ng update without any package name. Since in this cases an update to date update executer is not neccessary.

  5. added a commit that references this issue on Oct 6, 2022
    380ac42
  6. added
    freq1: low
    on Oct 6, 2022
  7. added a commit that references this issue on Oct 6, 2022
    d26fe37
  8. added 2 commits that reference this issue on Oct 6, 2022
    3202410
    28b2cd1
  9. added a commit that references this issue on Oct 7, 2022
    a607a7c
  10. angular-automatic-lock-bot commented on Nov 6, 2022

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

  11. locked and limited conversation to collaborators on Nov 6, 2022
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

    area: @angular/clifreq1: lowng update DXseverity2: inconvenient

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions