ng upgrade: incompatible peer dependency error prevents from auto-updating
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
upgradebranch of repo https://github.com/juristr/ng-upgrade-test yarn install(ornpm install=> I used yarn)- Try upgrading the Angular dependencies, using for instance
ng update @angular/core. I already performed the@angular/cliupgrade command which adjusts theangular.jsonetc.
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)
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.
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 .
Reinstalling cli worked for me as it installed latest. npm uninstall @angular/cli npm install @angular/cli
after this all ng update worked
@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).
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.
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.