x)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Yes, the previous version in which this bug was not present was: ....
Actually this command never worked.
A clear and concise description of the problem...
ng update cannot handle incompatible peer dependency.
Whenever you what to update your Angular packages, run ng update --all
$ ng update --all
Using package manager: 'npm'
Collecting installed dependencies...
Found 40 dependencies.
Package "@angular/core" has an incompatible peer dependency to "zone.js" (requires "~0.9.1", would install "0.10.1")
Package "@angular/core" has an incompatible peer dependency to "zone.js" (requires "~0.9.1", would install "0.10.1").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
Update a single package also has problem:
$ ng update @angular/core
Using package manager: 'npm'
Collecting installed dependencies...
Found 40 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.1 < 3.5", would install "3.5.3").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
This problem has been here for years:
And there are more.
I see this message all the time, and I get Package "@angular/core" has an incompatible peer dependency to "zone.js" (requires "~0.9.1", would install "0.10.2") when going from @angular/core 8.2.6 -> 8.2.8.
Semantic versioning would seem to dictate that 0.10.2 is simply a better version of 0.9.1. So it leaves me confused that angular would complain about this. Is there something about @angular/core that is depending on a bug or implementation quirk of this older version so that it would not be able to run on the newer version?
There are special semantic versioning rules for a version that has a 0 major version number. In that case, the minor version acts as a quasi-major version. For further details, please see the following: https://github.com/npm/node-semver#caret-ranges-123-025-004
Thanks @clydin Seems silly to have the semantic versioning lose it's meaning sometimes, but whatever, not my baby. Anyway, you got any insight on why Angular can't work with Typescript 3.6.3, but works fine with 3.5.3?
TypeScript doesn't strictly follow semantic versioning. Breaking changes can occur in minor versions. This is especially relevant to Angular because it uses many of the TypeScript compiler APIs within the Angular AOT compiler.
Seems like we should just repackage Typescript and other offending packages like zone.js into ones in which the semver is restored (zone.js has been around for 6 years, it's time for it to outgrow the leading 0). Then we can get back to npm update because ng update also feels unnecessary.
I'm running through an update right now and ng update tells me everything is fine and dandy. But npm outdated tells me that @angular-devkit/schematics is behind. Since @angular-devkit/schematics was installed when I installed Angular CLI and ng update is the command that came with Angular CLI, I would expect it to get updated with Angular CLI, but apparently that's not the case.
Anyway, for me, this worked for the main situation: just use the ng update --force option. My tests are passing for both zone.js 0.9.1 and 0.10.2. Ymmv.
I faced the same issue. ng update --all never works because of any incompatible typescript version. It's very frustrating. The only workaround is to do the updates step by step. Why does the manual update work but not the update using --all? Doesn't make sense to me.
Any update on this? I get the same issue upgrade angular8 to angular9.
this is the most hilariously awful issue i think ive come across. there has not been a single time i've tried to update my angular version without running into this same stupid issue. how is it that @angular/http is NEVER compatible with the latest versions of angular? how could it already be up to date if angular core is 1, 2, 3, 1827 versions ahead? At this point i have to just assume this is a game to whoever tf is behind this process because it's an absolute JOKE. Stop releasing a new version of your framework every 3 weeks and fix your update process. Package "@angular/http" has an incompatible peer dependency to "@angular/core" (requires "7.2.16" (extended), would install "10.0.9"). ridiculous...
@rrrroooorrrr, it鈥檚 looks like your application still depends on @angular/http which was deprecated back in 2017. This package is no longer release as by now applications should have moved on and are using @angular/common/http instead.
@alan-agius4 thank you for your help. i can admit i might be at fault for that one, but this process has rubbed me the wrong way too many times.
Most helpful comment
I faced the same issue.
ng update --allnever works because of any incompatible typescript version. It's very frustrating. The only workaround is to do the updates step by step. Why does the manual update work but not the update using--all? Doesn't make sense to me.