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

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

本文关键字:项目 Typescript 版本 angular Studio 2013 找不到 Visual      更新时间:2023-09-26
我需要使用 VS 2013

为 angular 2 SPA 开发设置一个工作环境(公司问题要求我使用 2013,我不能使用 2015,即使它会让事情变得更容易)。

我已经通过 npm 和安装程序安装了打字稿 Microsoft 可用,并且我达到了最新版本(截至我撰写本文时的 1.7.5)。

我创建了一个 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.

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.   

我不确定这意味着什么...我必须添加打字稿作为 PATH 变量吗?我该怎么做?

我最初是使用 WebStorm 进行开发的,它的开发起来要舒适得多。我只是点击了"gulp",它会侦听 .ts 文件和 .scss 并在保存时编译它们。然后单击 npm start 将启动一个自动刷新客户端...我不需要做任何其他事情...

是否有可能以某种方式在VS中重现这种工作环境?如何让 VS 正常运行我的角度 2 应用程序?

转到C:''程序文件 (x86)''Microsoft SDK''TypeScript''1.7复制所有文件,使新文件夹重命名为1.7并全部粘贴在其中

C:''Program Files (x86)''Microsoft SDKs''TypeScript''1.7''1.7!!!现在这项工作!