【问题标题】:How to run angular2 in visual studio 2012?如何在 Visual Studio 2012 中运行 angular2?
【发布时间】:2017-02-15 14:35:21
【问题描述】:

我需要在 Visual Studio 2012 中使用 angular2。我尝试使用以下网址,https://www.codeproject.com/Tips/1026938/AngularJS-Getting-Started-with-Visual-Studio 但它对我不起作用(第 3 步)

'tsd' 不是可识别的命令,并且 typescript 构建也不可用。 能否请您提供一个解决方案。在此先感谢!

【问题讨论】:

  • 首先你需要安装 npm,然后使用命令 npm install -g tsd 安装 tsd // 它将全局安装 tsd
  • 是的!我按照你说的尝试过。但它不起作用。我认为pixelbits的回答会有所帮助。谢谢!

标签: angular visual-studio-2012 typescript-typings


【解决方案1】:

很遗憾,VS2012 与最新版本的 TypeScript 不兼容。

VS2012 TypeScript 扩展支持最高 v1.0:

http://www.microsoft.com/en-ca/download/details.aspx?id=34790

如果你打算在你的 Angular2 应用程序中使用 TypeScript,你应该考虑更新到 Community VS 版本:

https://www.visualstudio.com/vs/community/

然后安装VS2015 TypeScript扩展(TypeScript v2.1.5)

https://www.microsoft.com/en-us/download/details.aspx?id=48593

【讨论】:

  • 可以在 angular2 应用程序中使用 javascript 吗?如果可以,您能分享一些链接吗?
  • 可以,但我建议使用 TypeScript。忘记 Visual Studio。使用 VS Code:code.visualstudio.com 并通过以下方式安装 TypeScript:npm install -g typescript。确保首先安装 node.js:nodejs.org/en
  • 非常感谢!@pixelbits
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多