gpt4 book ai didi

visual-studio-2017 - core/src/render3/interfaces 中的 Angular 构建错误

转载 作者:行者123 更新时间:2023-12-03 17:32:00 28 4
gpt4 key购买 nike

在构建 Angular 6 应用程序时,我在 @angular/core/src/render3/interfaces 中收到编译错误在第 35 行。该行是:

   [ACTIVE_INDEX]: number | null;

错误是: error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
我正在使用 @angular/core@6.1.6 .我做错了什么还是这是一个 Angular 错误?

最佳答案

验证 Visual Studio is targeting the correct version of Typescript (如您的 package.json 所示),然后尝试删除您的 node_modules文件夹,然后重新运行 npm install .

我相信这是由于使用较早的、不兼容的 typescript 版本 (<2.7) 运行 Angular 6 造成的,因为它看起来像是 container.d.ts 使用的功能。在 Typescript 2.7 中添加了使用常量命名属性的文件(在您的错误中引用) .当然,如果真的那么简单,那么ng serve会告诉你 Typescript 不兼容,所以我假设我错了,或者你的环境在欺骗你。

See here for a related question.

关于visual-studio-2017 - core/src/render3/interfaces 中的 Angular 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52210771/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com