【问题标题】:visual studio typescript conflict with angular 2Visual Studio 打字稿与 Angular 2 冲突
【发布时间】:2016-11-21 01:41:56
【问题描述】:

我刚刚开始了一个新项目,以使用 angular 2 开发应用程序并使用 Visual Studio 2015(更新 3)键入脚本,但出现错误: “tsc.exe 以代码 2 退出”。 当我打开我的项目属性时,我无法从那里配置打字稿,错误是“检测到一个或多个 tsconfig.json 文件”。 我想可能是因为 node_modules 子文件夹中有一堆 tsconfig.json 文件,所以我在我的 tsconfig.json 中排除了 node_modules 文件夹,但似乎 VS 无法找到并使用我的 tsconfig.json。 实际上,在浪费了几个小时来纠正这个问题之后,我现在不知道如何解决这个问题并在 Visual Studio 中使用 typescript 运行一个简单的 angular 2 项目。 任何关于如何解决这个问题的想法都值得赞赏。

【问题讨论】:

  • 您检查详细输出了吗? Visual Studio > Tools > Options > Compile and Run 并将 MS Build Project 输出设置为 detailled。现在再次构建并检查是否可以从输出中获取更多详细信息。我之前多次遇到过这个错误 - 出现主要是因为 Visual 想要编译 3rd 方角度库,尽管我通过我的 tsconfig 文件排除了它们..
  • @fen89 我想用我的 tsconfig 排除它们,但问题是 vs 找不到我的 tsconfig,我认为问题是角度库中存在多个 tsconfig。

标签: javascript visual-studio typescript angular visual-studio-2015


【解决方案1】:

类似于此处描述的错误:https://github.com/Microsoft/TypeScript/wiki/Common%20Errors

检查您的文件编码是否为 UTF-8。

【讨论】:

    猜你喜欢
    • 2017-06-27
    • 2012-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    • 2018-02-19
    相关资源
    最近更新 更多