Skip to content

Commit f51cde7

Browse files
alan-agius4mgechev
authored andcommitted
fix(@angular/cli): resolve external schematics from workspace root
Resolve schematics collections from the workspace root, as otherwise it will be resolved from the temporary installed CLI version Closes #18083
1 parent c9f5304 commit f51cde7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
667667
for (const migration of migrations) {
668668
const result = await this.executeMigrations(
669669
migration.package,
670-
migration.collection,
670+
// Resolve the collection from the workspace root, as otherwise it will be resolved from the temp
671+
// installed CLI version.
672+
require.resolve(migration.collection, { paths: [this.workspace.root] }),
671673
new semver.Range('>' + migration.from + ' <=' + migration.to),
672674
options.createCommits,
673675
);

0 commit comments

Comments
 (0)