From ae04726a50b7684a1e8dd07be7419d9249ccfe3a Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 5 Feb 2021 12:57:43 -0500 Subject: [PATCH] fix(@angular/cli): correctly access root workspace path --- packages/angular/cli/commands/add-impl.ts | 2 +- packages/angular/cli/commands/new-impl.ts | 2 +- packages/angular/cli/commands/update-impl.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/angular/cli/commands/add-impl.ts b/packages/angular/cli/commands/add-impl.ts index dd58b60c6271..1ca0731e501d 100644 --- a/packages/angular/cli/commands/add-impl.ts +++ b/packages/angular/cli/commands/add-impl.ts @@ -38,7 +38,7 @@ export class AddCommand extends SchematicCommand { } async run(options: AddCommandSchema & Arguments) { - await ensureCompatibleNpm(this.context.root); + await ensureCompatibleNpm(this.workspace.root); if (!options.collection) { this.logger.fatal( diff --git a/packages/angular/cli/commands/new-impl.ts b/packages/angular/cli/commands/new-impl.ts index 3574ed7769e3..b13f42b81be9 100644 --- a/packages/angular/cli/commands/new-impl.ts +++ b/packages/angular/cli/commands/new-impl.ts @@ -24,7 +24,7 @@ export class NewCommand extends SchematicCommand { } public async run(options: NewCommandSchema & Arguments) { - await ensureCompatibleNpm(this.context.root); + await ensureCompatibleNpm(this.workspace.root); // Register the version of the CLI in the registry. const packageJson = require('../package.json'); diff --git a/packages/angular/cli/commands/update-impl.ts b/packages/angular/cli/commands/update-impl.ts index a5cdea32c32b..527dc474a5b5 100644 --- a/packages/angular/cli/commands/update-impl.ts +++ b/packages/angular/cli/commands/update-impl.ts @@ -254,7 +254,7 @@ export class UpdateCommand extends Command { // tslint:disable-next-line:no-big-function async run(options: UpdateCommandSchema & Arguments) { - await ensureCompatibleNpm(this.context.root); + await ensureCompatibleNpm(this.workspace.root); // Check if the @angular-devkit/schematics package can be resolved from the workspace root // This works around issues with packages containing migrations that cannot directly depend on the package