angular-cli: Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1")
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Node Version: v8.11.4
npm Version: 6.4.1
ng Version:
Angular CLI: 7.0.4
Node: 8.11.4
OS: win32 x64
Angular: 7.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.4
@angular-devkit/build-angular 0.10.4
@angular-devkit/build-optimizer 0.10.4
@angular-devkit/build-webpack 0.10.4
@angular-devkit/core 7.0.4
@angular-devkit/schematics 7.0.4
@angular/cli 7.0.4
@ngtools/webpack 7.0.4
@schematics/angular 7.0.4
@schematics/update 0.10.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
Repro steps
ng update --all
The log given by the failure
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1").
Incompatible peer dependencies found. See above.
Desired functionality
Mention any other details that might be useful
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 70
- Comments: 31
Commits related to this issue
- ng update to get latest ng update --all needs --force [kus@localhost testastic]$ nvm install node Downloading and installing node v11.10.0... Downloading https://nodejs.org/dist/v11.10.0/node-v11.10... — committed to onewyoming/onewyoming by 9034725985 5 years ago
- use typescript 3.2.4 ng compiler cannot into 3.3 + ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.3.3 was found instead. Angular Compiler refuses to work with the latest... — committed to onewyoming/onewyoming by 9034725985 5 years ago
- :arrow_up: Upgrade dependencies See angular/angular-cli#13095 — committed to SPGoding/spu-angular by SPGoding 5 years ago
- fix(@angular/cli): no-op ng update --all '--all' functionality has been removed from `ng update` as updating multiple packages at once is not recommended. To update the depencencies in your workspace... — committed to angular/angular-cli by alan-agius4 4 years ago
@billfranklin Sorry, I mistook ng-update with https://www.npmjs.com/package/npm-check-updates. Yes, this is a bug. ng-update should update typescript to latest supported version. But I don’t think it will be resolved soon: https://github.com/angular/angular-cli/issues/11138#issuecomment-395494996.
@dalu You can do:
ng update --all --force
and thennpm i typescript@3.1.6
(or even better:npm i typescript@"<3.2"
)EVERY SINGLE TIME
Not sure if this will help anyone else, but I was running the following to no avail:
ng update --all --force
npm install typescript@">=3.1.1 <3.2"
I needed to add
RUN npm install typescript@">=3.1.1 <3.2"
to my Dockerfile just after it completed an npm install of my package.json. Not sure if anyone else needs this pointed out, but wanted to mention in case it helps anyone else. Cheers!This is not an option since versions always are bumping. E.g. now it states that @angular/core conflicts with latest zone.js version and tsickle conflicts with latest typescript version.
ng update
definetly should take care of its own dependencies at least.Every time I go on
ng update
this issue still apears. Even at angular-cli 7.3.6. It’s solved just with:npm i typescrispt@3.2.4
just afterng update
as this is the last typescript version accepted.npm install typescript@“>=3.1.1 ❤️.2”
Hi @billfranklinIt’s normal behavior.Latest@angular/angular-cli:7.1.0
is shipped withtypescript:3.1.6
and supports only patches:typescript < 3.2
.Newesttypescript:3.2.1
increments minor version (typescript:3.1.6
in@angular/angular-cli:7.1.0
) and should not have breaking changes but it’s safer to limittypescript
updates to patches.~~See https://semver.org/~~ https://github.com/angular/angular-cli/issues/13095#issuecomment-443523984
I had the same problem upgrading from angular-cli@7.1.1 to the latest 7.2.15 and had the error come up with typescript@3.2.4 (well within the >= 3.1.1 < 3.3 requirement). The solution was to manually install the following:
Then my project compiled successfully with zero vulnerabilities or warnings showing up. I hope this helps others getting the same error message
This just hit me again with typescript 3.3.4. Why have this automatic update which gets destroyed by the higher version of typescript?
i really don’t get this, what is the use of “ng update” when it is not really usable at all? Why is something that updates angular that understands angular not be able to leave typescript alone or upgrade it to the latest supported version?
@KrzysztofKarol This also makes it impossible to install “@angular/cli” with the latest version of “@angular/core”. I don’t see how that’s normal behaviour. Surely the latest version of the CLI should be compatible with the latest version of the framework?
ng update --all --force
npm install typescript@3.4.5 --save-exact(you don’t even need this anymore with angular 8.2.0, it works with the latest typescript@3.5.3)That’s my version of ng update.
Very similar to what I have in my package.json file:
Saves me the headache of updating.
Another reproduction with some more details can be found here: https://github.com/angular/angular-cli/issues/14420#issue-443916012
same issue here