Skip to content

Commit 75fd333

Browse files
committed
fix(@angular/cli): during an update only use package manager force option with npm 7+
The package manager `--force` option is only relevant to npm 7+ wherein the option controls the strictness of the npm 7+ peer dependency resolution. Yarn 2+ does not support a `--force` option. When the `ng update` `--force` option was used, `ng update` was incorrectly applying the package manager `--force` option to Yarn which lead to an installation failure. This has now been corrected and the package manager `--force` option is now only applied to npm 7+. (cherry picked from commit 7ddc3fe)
1 parent 7c46969 commit 75fd333

File tree

1 file changed

+1
-1
lines changed
  • packages/angular/cli/src/commands/update

1 file changed

+1
-1
lines changed

packages/angular/cli/src/commands/update/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
686686
});
687687
} catch {}
688688

689-
let forceInstall = options.force;
689+
let forceInstall = false;
690690
// npm 7+ can fail due to it incorrectly resolving peer dependencies that have valid SemVer
691691
// ranges during an update. Update will set correct versions of dependencies within the
692692
// package.json file. The force option is set to workaround these errors.

0 commit comments

Comments
 (0)