将Angular 5升级到6,VST S构建后出错

问题描述 投票:0回答:1

从Angular 5升级到6后,我已经在本地运行了。它运行在构建和构建--prod。我确实在.NET MVC应用程序中使用它。但是,当VSTS上的构建通过它时会弹出一些错误。它说。

node_modules\@angular\compiler\src\output\output_ast.d.ts(602,15): Error TS2474: Build:In 'const' enum declarations member initializer must be constant expression.

node_modules\@angular\core\src\render3\interfaces\container.d.ts(35,5): Error TS1169: Build:A computed property name in an interface must directly refer to a built-in symbol.

node_modules\@angular\core\src\sanitization\bypass.d.ts(55,14): Error TS2535: Build:Enum type 'BypassType' has members with initializers that are not literals.

只有VSTS上的构建失败并且它出现在CompileTypeScriptWithTSConfig的过程中:

我运行的是typescript version 2.7.2,我已经将csproj Typescript版本设置为2.7。由于Visual Studio不支持2.9.2而Angular 6.1.4不支持3.0.0版本

angular visual-studio typescript azure-devops angular6
1个回答
1
投票

您的VSTS版本必须使用早于2.7的TypeScript版本,因为2.7及更高版本中不存在错误消息A computed property name in an interface must directly refer to a built-in symbol.。看起来你需要使用至少2.7来编译那些类型声明文件。我不知道是什么控制了你的VSTS版本的TypeScript版本;如果您提供更多信息,我可以提供更多帮助。

© www.soinside.com 2019 - 2024. All rights reserved.