简体   繁体   English

Visual Studio 2013找不到用于angular 2项目的Typescript版本

[英]Visual Studio 2013 can't find version of Typescript for angular 2 project

I need to set up a working environment for angular 2 SPA development using VS 2013 (company issues require me to use 2013, I can't use 2015 even though it would make things easier). 我需要为使用VS 2013的angular 2 SPA开发设置一个工作环境(公司问题要求我使用2013,尽管这样做会使事情变得容易,但我无法使用2015)。

I've installed typescript through npm and through the installer Microsoft as available and I'm up to the latest version (1.7.5 as of the moment I'm writing). 我已经通过npm和可用的安装程序Microsoft安装了Typescript,并且我已经安装了最新版本(截至撰写本文时为1.7.5)。

I created a Typescript application and I get the following errors on build (without having added any code). 我创建了一个Typescript应用程序,并且在构建时遇到以下错误(未添加任何代码)。

Error   1   Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine.  No compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.7\1.7\tsc.exe.  You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file.

The TypeScriptToolsVersion in csproj is at 1.7 which seems fine to me. csproj中的TypeScriptToolsVersion为1.7,对我来说似乎还不错。

Error   2   The specified task executable location "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.7\1.7\tsc.exe" is invalid.   

I'm not sure what this means... do I have to add typescript as a PATH variable? 我不确定这是什么意思...我必须将Typescript添加为PATH变量吗? How do I do that? 我怎么做?

I was initially developing using WebStorm, which was far more confortable to develop. 我最初使用WebStorm进行开发,因此开发起来更加舒适。 I just clicked on "gulp" and it would listen for .ts files and .scss and compile them on save. 我只是单击“ gulp”,它将侦听.ts文件和.scss并在保存时进行编译。 Then clicking npm start would boot up an auto-refreshing client... I wouldn't need to do anything else... 然后单击npm start将会启动一个自动刷新的客户端...我不需要做任何其他的事情...

Is it possible to reproduce this working environment in VS somehow? 是否可以以某种方式在VS中重现此工作环境? How can I get VS to run my angular 2 app normally? 如何使VS正常运行我的angular 2应用程序?

go to C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.7 copy all file , make new folder rename that to 1.7 and paste all in that 转到C:\\ Program Files(x86)\\ Microsoft SDKs \\ TypeScript \\ 1.7复制所有文件,将新文件夹重命名为1.7,然后将所有内容粘贴到该文件夹​​中

C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.7\\1.7 !!! C:\\ Program Files(x86)\\ Microsoft SDKs \\ TypeScript \\ 1.7 \\ 1.7 !!! this work for now! 这项工作现在!

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

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