gpt4 book ai didi

angular - 带有Angular的Docker报错 “ERROR in No NgModule metadata found for ' AppModule'。”

转载 作者:行者123 更新时间:2023-12-02 19:52:15 24 4
gpt4 key购买 nike

尝试在Azuredev操作上使用Docker创建Angular 7构建。但是得到错误。

enter image description here

如果我在package.json中更改CLI版本,则可以正常工作。但是在创建版本时给了我其他错误。

由于使用单spa创建应用程序,因此CLI版本更改需要在多个位置进行更改。

任何人都可以处理并确认我的解决方案吗?

最佳答案

如果更新Angular和CLI,这似乎是一个常见问题。

建议的解决方案是清理重新安装Angular和CLI。

npm remove webpack
npm install --save-dev @angular/cli@latest.

您可以针对同一问题引用 "No NgModule metadata found for 'AppModule'" after UpgradeERROR in Error: No NgModule metadata found for 'AppModule'.

如您在第二个链接中看到的,此问题可能是由多种不同的原因引起的,其中一些是代码,一些是Angular和CLI版本。

关于angular - 带有Angular的Docker报错 “ERROR in No NgModule metadata found for ' AppModule'。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59949682/

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