Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which typescript version running on angular 4 project

So i did ng -v it shows me everything except typescript, so how can i check Typescript version of my angular 4 project.

like image 501
RajnishCoder Avatar asked Oct 17 '17 06:10

RajnishCoder


People also ask

How can I tell what version of TypeScript is on my project?

Go to: C:\Program Files (x86)\Microsoft SDKs\TypeScript, there you see directories of type 0.9, 1.0 1.1. Enter the high number that you have (in this case 1.1) Copy the directory and run in CMD the command tsc -v, you get the version.

Which version of TypeScript does angular use?

Angular now uses TypeScript 3.4.


2 Answers

Open package.json file and check devDependencies node. It has typescript version used in project like below.

"typescript": "^2.4.0", 

You can also use command prompt as Sajeetharan suggested in below answer.

like image 93
Karan Patel Avatar answered Oct 22 '22 03:10

Karan Patel


If you want the exact version installed as a package dependency use the ls command:

npm ls typescript 

Alternatively, you could run tsc with the -v flag:

If installed locally:

node_modules\.bin\tsc -v 

If installed globally:

tsc -v 

NOTE: If you plan on checking package.json for the version number, keep in mind the caret in ^2.4.0 means you could be getting 2.4.x, 2.5.x 2.6.x, etc. The ^ tells you the minor version will automatically be updated to the latest version upon a fresh install or an npm update.

If the version number is preceeded by ~ (i.e. ~2.4.0), then the patch number is automatically updated on a new install or update. That means any of the following versions could be installed: 2.4.0, 2.4.1, 2.4.2, etc, but not 2.5.x

like image 44
pixelbits Avatar answered Oct 22 '22 02:10

pixelbits