VS2015 - 更改 TypeScript 版本 [英] VS2015 - Change TypeScript Version
问题描述
我正在尝试将我的 Visual Studio 2015 + Cordova + TypeScript 项目更新为使用 TypeScript 版本到 1.6.0-beta
.我目前正在使用 1.5.3
.
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
.
我可以使用 NPM 安装最新版本,但我的项目继续使用旧版本.npm install -g typescript
I am able to use NPM to install the latest version, but my project continues using the old version.
npm install -g typescript
如何让我的项目使用最新的 TypeScript 版本?
TypeScript 版本的位置:
Locations of TypeScript Versions:
1.5.3
= C:Program Files (x86)Microsoft SDKsTypeScript1.5
1.6.0-beta
= C:UsersXXXAppDataRoaming
pm
1.6.0-beta
= C:UsersXXXAppDataRoaming
pm
--------------------- 2015 年 9 月 4 日更新 --------------------------
--------------------- Updated 9/4/2015 --------------------------
我将项目 .jsproj 文件 XML 元素
更新为
.我将文件夹 1.6.0-beta
和 NPM 文件添加到 C:Program Files (x86)Microsoft SDKsTypeScript
并且 VS2015 不使用最新的 TypeScript.
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 SDKsTypeScript
and VS2015 doesn't use the latest TypeScript.
我错过了什么吗?
推荐答案
这是在 Visual Studios 2015 中升级 TypeScript 的解决方案:
Here's the solution to upgrading TypeScript in Visual Studios 2015:
从以下网站下载 TypeScript EXE 版本:
点击详情查看其他版本:这里我想下载1.6.0 Beta
Click the details to view other releases: In this case I want to download 1.6.0 Beta
下载 exe 并安装到计算机上.
在 VS2015 中创建一个新的 TypeScript Cordova 项目.VS2015 可能会询问是否要将项目升级到最新版本.根据需要遵循指示.
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.
更新现有项目
如果已有项目需要使用特定版本的TypeScript,按照上述步骤下载TypeScript版本,修改.jsproj文件的XML元素C:Program Files (x86)Microsoft SDKsTypeScript
文件夹中的文件夹名称.文件夹名称代表安装的 TypeScript 版本.
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 SDKsTypeScript
folder. The folder name represents the installed TypeScript version.
这篇关于VS2015 - 更改 TypeScript 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!