代码之家  ›  专栏  ›  技术社区  ›  Sam Herrmann

禁用ng packagr中的TypeScript不匹配

  •  0
  • Sam Herrmann  · 技术社区  · 6 年前

    @angular/compiler-cli@6.1.0 requires typescript@'>=X.X.X <Y.Y.Y' but Z.Z.Z was found instead.
    Using this version can result in undefined behaviour and difficult to debug problems.
    

    可以使用以下命令为默认项目禁用TypeScript不匹配警告:

    ng config cli.warnings.typescriptMismatch false
    

    ng-packagr 将此警告作为错误抛出,即使 typescriptMismatch 设置为 false . 是否可以暂时禁用此错误?可以理解,这不应该在生产环境中进行,但在调试可能由TypeScript引起的问题时可能会有所帮助。以下 StackOverflow question 作为一个示例用例。

    1 回复  |  直到 6 年前
        1
  •  3
  •   A. Agius Roger Saladrigas    6 年前

    你需要使用 disableTypeScriptVersionCheck 在下面 angularCompilerOptions 在你的配置中。

    推荐文章