angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng upgrade: incompatible peer dependency error prevents from auto-updating

Open juristr opened this issue 8 years ago • 46 comments

Versions

Angular CLI: 6.0.1
Node: 9.11.1
OS: darwin x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@angular/cli                      6.0.1
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              5.5.10
typescript                        2.5.3
webpack                           4.6.0


macOS 10.11.6

Repro steps

  • Clone the upgrade branch of repo https://github.com/juristr/ng-upgrade-test
  • yarn install (or npm install => I used yarn)
  • Try upgrading the Angular dependencies, using for instance ng update @angular/core. I already performed the @angular/cli upgrade command which adjusts the angular.json etc.

Observed behavior

<!-- Normally this includes a stack trace and some more information. -->

I get the following output

❯ ng update @angular/core
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.5.3")
Incompatible peer dependencies found. See above.

Desired behavior

It should automatically update the Angular dependencies as well as RxJS and TypeScript (as described in the update.angular.io guide).

Mention any other details that might be useful (optional)

juristr avatar May 15 '18 21:05 juristr

I didn't want to use --force as it installs unstable packages and also... we shouldn't have to.

I found a solution to the above that worked for me. I installed the latest codelyzer

npm install codelyzer@latest --save-dev

then ran the ng update @whatever I needed to do and it worked with no complaints.

cjonasw avatar Jul 03 '19 22:07 cjonasw

Thanks charlie for your suggestion, will follow the suggestion when i get any further issues/errors.

Thank You,

Adhi Venkatesh.,Banglore,India.

On Wed, Jul 3, 2019 at 10:38 PM Charlie Walter [email protected] wrote:

I didn't want to use --force as it installs betas and also one shouldn't have to.

I found a solution to the above that worked for me. I installed the latest codelyzer

npm install codelyzer@latest

then ran the ng update @whatever I needed to do and it worked with no complaints.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/10875?email_source=notifications&email_token=AG5YZMSI2J2LCKZXQHPFAPDP5US5HA5CNFSM4FABH5TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZF3GNI#issuecomment-508277557, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5YZMW67XWJJ2HEUP42XCTP5US5HANCNFSM4FABH5TA .

adhivenkatesh avatar Jul 05 '19 18:07 adhivenkatesh

Reinstalling cli worked for me as it installed latest. npm uninstall @angular/cli npm install @angular/cli

after this all ng update worked

ahmar-appify avatar Aug 06 '19 13:08 ahmar-appify

@Splaktar I have tried the --from and --to options but they are not working: still they are upgrading directly to the last version available.

I had to install the specific version (ng update @angular/[email protected]) both for core and cli, and then update manually the package.json to update every single module that my application needs (http, common, forms, etc).

Ferie avatar Aug 12 '19 15:08 Ferie

The --from and --to options will only affect the --migrate-only option. CLI versions 8.0+ will now error if the options are used incorrectly.

clydin avatar Aug 12 '19 17:08 clydin

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.