Skip to content

fix(@angular/cli): explain the latest version fallback when ng add finds no compatible version - #34615

Closed
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/ng-add-latest-fallback-message
Closed

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/ng-add-latest-fallback-message

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

When no version of the package satisfies the peer dependencies of the project, ng add reports Unable to find compatible package. and then continues to install the version of the latest tag. The explanation that the latest tag is used was dropped when the command was migrated to the new package manager abstraction, so the installation that follows the message is unexpected.

Restore the Using 'latest' tag. explanation.

…nds no compatible version

When no version of the package satisfies the peer dependencies of the project,
`ng add` reports `Unable to find compatible package.` and then continues to
install the version of the `latest` tag. The explanation that the `latest` tag is
used was dropped when the command was migrated to the new package manager
abstraction, so the installation that follows the message is unexpected.

Restore the `Using 'latest' tag.` explanation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the fallback warning message in packages/angular/cli/src/commands/add/cli.ts when a compatible package is not found, explicitly stating that the 'latest' tag will be used. There are no review comments, and I have no additional feedback to provide.

@alan-agius4

alan-agius4 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closing this PR as the added text does not reflect the behavior.

When no compatible package version is found, the CLI does not fall back to the latest tag. In fact, latest was already tested and rejected earlier in the search due to peer dependency conflicts (Could not find a compatible version with 'latest'). Instead, context.packageIdentifier retains the initial unconstrained range (*), which loadPackageInfoTask resolves to ^<version> (and warns about unmet peer dependencies) before prompting the user to install that version. Because the latest tag is not used or installed, adding Using 'latest' tag. is inaccurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants