gpt4 book ai didi

angular - 升级到 Angular 5.2.2 后“ng build --prod”不起作用

转载 作者:行者123 更新时间:2023-12-02 21:24:44 26 4
gpt4 key购买 nike

过去几个月我正在开发的应用程序是 Angular 4.3.4,我决定将其更新到最新版本 5.2.2。

简单来说,当我尝试使用“ng build --prod”构建产品时,CLI 向我抛出此错误:

ERROR in Error during template compile of 'ea'
Function calls are not supported in decorators but 'emakeDecorator' was
called in 'Injectable'
'Injectable' calls 'emakeDecorator'

我尝试了很多事情,包括删除node_modules和package-lock.json、更新npm并尝试版本5.2.0而不是5.2.2。似乎没有任何作用。

有人遇到同样的问题吗?

谢谢!

最佳答案

我自己修好了。信用归https://github.com/sureshchahal/angular2-adal/issues/23 Gullfaxi 的评论。

这个问题与 AOT 编译有关,但不要再问我这个问题了。我无法详细解释任何事情。

但是,请转到 tsconfig.app.json 并添加以下行:

"paths": { "@angular/*": ["../node_modules/@angular/*"] },

还要确保在同一文件中,模块设置为“es2015”。

希望这对您有用!

关于angular - 升级到 Angular 5.2.2 后“ng build --prod”不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48558366/

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