Multiple ways to know typescript version in Angular 12/13


This tutorials covers an how to find typescript version in Angular framework.

angular wysiwyg Rich text editor ngx-quilljs Angular is based on typescript. Typescript is popular programming langugage from Microsoft. It is an extended javascript with typing and oops support

{{ toc }}

How to find typescript version in Angular 12 project.

Angular uses typescript as language for writing a components. As a developer we need to know the typescript versions, if you install incompatable typescript version in angular applicaiton, you will get an following error.

Error: The Angular Compiler requires TypeScript >=4.0.1 and 4.1.7 but 4.2.0 was found instead.

You can also check other post fixing Angular Compiler requires TypeScript

There are many ways we can find typescript version in Angular app.

  • using package.json
  • tsc command
  • ng version command

using package.json

First, In the project, package.json file contain typescript dependencies information. package.json

{
"typescript": "^4.2.0",
}

tsc command

if typescript installed into application, tsc is the command being used to know typescript version.

 B:\angular-example>tsc --version
Version 4.2.4

ng version command Second way, using ng command, you can get angular and typescript versions installed into angular application.

you can use one of the below command.

ng -v  
ng --version
ng version

Here is an command output

B:\angular-example>ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 12.0.3
Node: 14.17.0
Package Manager: npm 7.11.1
OS: win32 x64

Angular: 12.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.3
@angular-devkit/build-angular   12.0.3
@angular-devkit/core            12.0.3
@angular-devkit/schematics      12.0.3
@schematics/angular             12.0.3
rxjs                            6.6.7
typescript                      4.2.4

This command gives typescript version and angular dependencies versions

Angular TypeScript version compatibility list

The below table answers following questions

  • What is typescript version for Angular 11 version
  • which typescript version used in Angular 10 version
Parameter   Description  
Angular 13  TypeScript 4.3.0
Angular 12  TypeScript 4.2.0
Angular 11  TypeScript 4.0.3
Angular 10  TypeScript 3.7
Angular 9  TypeScript 3.7
Angular 8  TypeScript 3.4
Angular 7 Typescript 3.1
Angular 6 Typescript 3.0
Angular 5 Typescript 2.7
Angular 4  TypeScript 2.4
Angular 2 Typescript 2.0

How to find typescript version in Visual Studio Code?

It is very easy and simple to find typescript version in VSCode.

Following are sequence of step by step

  • First Go to Terminal menu item in VSCode

  • Select New Terminal and opens terminal window (or) you can use short cut command Ctrl + Shift +`

  • type following command

    b:\tsc -v
    Version 4.1.3
    

How to update/downgrade typescript version in Angular application

It is very easy to update to new version or latest version as wellas downgrade version to lower version with npm install command.

Here are sequence of steps.

Open terminal and go to angular application directory

if you want to install specific version, Here is an command

npm install typescript@4.2.0 --save-dev

to install latest versions,

npm install typescript@latest --save-dev

By this way, We can install typescript in Angular application with specific or latest version

This updates or an entry in package.json

How to uninstall typescript in Angular project

with npm uninstall, It will uninstall from angular application

npm uninstall typescript

And, It remove the dependencies from package.json

{
   "devDependencies": {
	"gulp-purgecss": "4.2.0",
  }
}

Conclusion

We have learned how to find the typescript version being used in Angular applicaiton, In this short tutorial, You learned multiple ways to know the typescript version in angular and visual studio code. It also includes Listout angular -2,4,5,6,7,8,9,10,11 and 12 versions and their typescript supported versions.

THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.