Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in The Angular Compiler requires TypeScript >=3.6.4 and <3.8.0 but 3.8.3 was found instead. #17134

Closed
bryanrideshark opened this issue Mar 2, 2020 · 5 comments

Comments

@bryanrideshark
Copy link
Contributor

Description

I just upgraded to Angular 9 using ng update --all --force -C. No other options worked.

Now when I run ng serve, I get an error, ERROR in The Angular Compiler requires TypeScript >=3.6.4 and <3.8.0 but 3.8.3 was found instead.

Why did Angular update me to Typescript 3.8.3 if it's not supported?

@petebacondarwin petebacondarwin transferred this issue from angular/angular Mar 2, 2020
@realharry
Copy link

@bryanrideshark You can manually update the typescript version (say, to 3.7.5) after "ng update".

In general, I run into this type of issues with virtually every angular version upgrade. This question is really for the Angular Team, but is there a reason why the maximum typescript version should be set for each Angular release? For example, in this particular case, is there a reason why we should presume that Angular 9 will not work with future versions of typescript (or, even with 3.8.x), say, instead of following the semantic versioning convention?

@clydin
Copy link
Member

clydin commented Mar 3, 2020

TypeScript does not strictly follow semantic versioning. Breaking changes are present in minor releases. Since the Angular compiler leverages TypeScript, each minor version needs to be validated before it can be officially supported.

The combination of the --all and --force flags are why TypeScript 3.8 was installed. If using just the -all flag, the following will be reported:

Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.6 < 3.8", would install "3.8.3")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.6 <3.8", would install "3.8.3")

The --all flag will attempt to update every package mentioned in the workspace's package.json to the latest version.

For information regarding recommended update procedures, please see https://update.angular.io/#8.0:9.0

@clydin clydin closed this as completed Mar 3, 2020
@simonua
Copy link
Contributor

simonua commented Mar 4, 2020

I found an older TypeScript GitHub issue that supports what @clydin is stating. Sigh.

microsoft/TypeScript#14116

@xinthose
Copy link

npm i typescript@">=3.6.4 <3.8.0"

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants