Skip to content

Commit 54b73d8

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular/cli): skip searching deprecated packages with ng add
When attempting to add a package via the add command, packages that have been marked as deprecated will no longer be installed when the deprecated package's peer dependencies match the project's dependencies. (cherry picked from commit 37686b6)
1 parent 83a4804 commit 54b73d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/cli/commands/add-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
115115
} else if (!latestManifest || (await this.hasMismatchedPeer(latestManifest))) {
116116
// 'latest' is invalid so search for most recent matching package
117117
const versionManifests = Object.values(packageMetadata.versions).filter(
118-
(value: PackageManifest) => !prerelease(value.version),
118+
(value: PackageManifest) => !prerelease(value.version) && !value.deprecated,
119119
) as PackageManifest[];
120120

121121
versionManifests.sort((a, b) => rcompare(a.version, b.version, true));

0 commit comments

Comments
 (0)