'ERROR in The Angular Compiler requires TypeScript >=3.6.4 and <3.8.0 but 3.8.2 was found instead

I ran

ng version

and got the following output:

Angular CLI: 9.0.3
Node: 12.16.1
OS: win32 x64

Angular: 9.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.25
@angular-devkit/build-angular     0.803.25
@angular-devkit/build-optimizer   0.803.25
@angular-devkit/build-webpack     0.803.25
@angular-devkit/core              8.3.25
@angular-devkit/schematics        9.0.3
@angular/cdk                      8.2.3
@angular/cli                      9.0.3
@angular/material                 8.2.3
@ngtools/webpack                  8.3.25
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.8.2
webpack                           4.39.2

If I try set the type script lower it complains the project is Angular 9 and can't use that type of type script. Not sure what to do, any help welcomed, thanks.



Solution 1:[1]

Use the version which set ng update command: npm install [email protected]

Solution 2:[2]

This means that Angular doesn't support TypeScript 3.8.x yet.

You can bypass this error with angularCompilerOptions.disableTypeScriptVersionCheck: true option in

tsconfig.json

"angularCompilerOptions": {
   ...
   "disableTypeScriptVersionCheck": true,
},

See also:

Solution 3:[3]

I had the same issue. I noticed my package-lock.json has typescript : 3.8.3. So I did npm i [email protected] and build my app and it worked.

Solution 4:[4]

If you get an error message saying The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 but x.x.x was found instead, please perform the following steps:

  1. Run npm i --save-dev-exact [email protected]
  2. Restart ng serve to serve the project on localhost:4200.

Solution 5:[5]

Initally Package.json has "typescript": "^3.7.5" and Package-lock.json has 3.9.10 .

I have resolved by giving exact version in Package.json as "typescript": "3.7.5" and run npm install . package-lock.json typescript property generated with given version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bjdose
Solution 2 yurzui
Solution 3 Dharman
Solution 4 pixel
Solution 5 Microtechie