简体   繁体   English

VS 2015使用旧的TypeScript版本

[英]VS 2015 uses old TypeScript version

I am using VS 2015. I've just installed TypeScript 1.6.3, restarted VS 2015 and VS seems to be still using an old tsc version: (btw the setup said [Repair], so I suppose this version was already installed) 我正在使用VS 2015.我刚安装了TypeScript 1.6.3,重新启动了VS 2015并且VS似乎仍在使用旧的tsc版本:(顺便说一下设置说[修复],所以我想这个版本已经安装了)

I've checked what tsc version I am using via PM console: 我已经通过PM控制台查看了我正在使用的tsc版本:

Package Manager Console Host Version 3.2.0.10516

Type 'get-help NuGet' to see all available NuGet commands.

PM> tsc -v
Version 1.0.3.0
PM> 

I've also checked my .csproj file and found: 我还检查了我的.csproj文件,发现:

<TypeScriptToolsVersion>1.6</TypeScriptToolsVersion>

and

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />

What am I missing? 我错过了什么?

在此输入图像描述

inside C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript delete all the folders exept 1.7 在C:\\ Program Files(x86)\\ Microsoft SDKs \\ TypeScript中删除所有文件夹exept 1.7

then run in terminal 然后在终端运行

tsc -v

if nothing run 如果没有运行

npm install -g typescript

and after 之后

tsc -v 

and you should see 1.7 version 你应该看到1.7版本

The primary reason for this is the fatal combination of... 造成这种情况的主要原因是...的致命组合

  1. Having multiple versions of TypeScript installed 安装了多个版本的TypeScript
  2. Having more thn one of the versions in your PATH variable 在PATH变量中有更多版本

If you go and remove all but the most recent version of TypeScript from the PATH environment variable, that will stop tsc commands picking up the wrong one. 如果从PATH环境变量中删除除最新版本的TypeScript以外的所有版本,那将停止tsc命令拾取错误的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM