I am trying to update my Visual Studio 2015 + Cordova + TypeScript project to use TypeScript version to 1.6.0-beta
. I am currently using 1.5.3
.
I am able to use NPM to install the latest version, but my project continues using the old version. npm install -g typescript
How can I make my project use the latest TypeScript version?
Locations of TypeScript Versions:
1.5.3
= C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.5
1.6.0-beta
= C:\Users\XXX\AppData\Roaming\npm
--------------------- Updated 9/4/2015 --------------------------
I updated the projects .jsproj file XML element <TypeScriptToolsVersion>1.5</TypeScriptToolsVersion>
to <TypeScriptToolsVersion>1.6.0-beta</TypeScriptToolsVersion>
. I added the folder 1.6.0-beta
and NPM files to C:\Program Files (x86)\Microsoft SDKs\TypeScript
and VS2015 doesn't use the latest TypeScript.
Am I missing something?
Tip: To get a specific TypeScript version, specify @version during npm install. For example, for TypeScript 3.6. 0, you would use npm install --save-dev [email protected] . To preview the next version of TypeScript, run npm install --save-dev typescript@next .
By default, it will install latest version. Or you can remove the orginal version, run yarn global remove typescript , and then execute yarn global add typescript , by default it will also install the latest version of typescript.
To see the last version: 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.
Here's the solution to upgrading TypeScript in Visual Studios 2015:
Download the TypeScript EXE release from the following website: http://www.microsoft.com/en-us/download/details.aspx?id=48593
Click the details to view other releases: In this case I want to download 1.6.0 Beta
Download the exe and install onto computer.
Create a new TypeScript Cordova project in VS2015. VS2015 may ask if you want to upgrade the project to the latest version. Follow the directions as necessary.
Updating Existing Projects
If you have an existing project that needs to use a specific version to TypeScript, download the TypeScript version using the above steps, and modify the .jsproj file's XML element <TypeScriptToolsVersion>1.6</TypeScriptToolsVersion>
. Set the number to the folder name located in C:\Program Files (x86)\Microsoft SDKs\TypeScript
folder. The folder name represents the installed TypeScript version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With