Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead

People also ask

What version of TypeScript does angular 12 use?

Angular 12 only supports Typescript 4.2.

What version of TypeScript does angular use?

Angular now uses TypeScript 3.4.

How do I install TypeScript specific version?

Every now and then it is common to see newer package versions, and TypeScript is not the exception. Hence, the version installed locally might not match the current latest version of the package. To install the latest TypeScript version, add @latest when using the same command to install TypeScript.

What version of TypeScript does angular 8 use?

Angular 8 supports the TypeScript 3.4 or above version. So, if we want to use Angular 8 for our application, then we need to first upgrade the TypeScript to 3.4 or above.


To fix this install the specific typescript version 3.1.6

npm i [email protected] --save-dev --save-exact

In my case below command worked for windows. It will install latest required version between 3.1.1 and 3.2.0. Depending on OS use either double or single quotes

npm install typescript@">=3.1.1 <3.2.0" 

First install your targeted version

npm i [email protected] --save-dev --save-exact

Then before compiling do

   npm i

If you want to use Angular with an unsupported TypeScript version, add this to your tsconfig.json to ignore the warning:

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

npm install typescript@">=3.1.1 <3.3.0" --save-dev --save-exact
rm -rf node_modules
npm install