我使用Angular CLI和Module Federation插件构建了一个微平台应用程序。当我尝试安装Angular Material或Kendo时,我遇到了这个问题:Bootstrap call not found
我通过此链接解决了此问题。不幸的是,我还有更多的问题:
- 安装Angular Material时,出现以下错误:
Your project is not using the default builders for "build". The Angular Material schematics cannot add a theme to the workspace configuration if the builder has been changed.
- 当我安装Kendo时,我遇到了这个错误:
Skipping installation: Package already installed. File node_modules/@progress/kendo-angular-buttons/package.json does not exist.
我找到了解决方案。在安装库之前,我用bootstrap.ts的内容替换了main.ts的内容:
main.ts:
/*import('./bootstrap')
.catch(err => console.error(err));
*/
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
安装库后,我恢复了它的内容:
import('./bootstrap')
.catch(err => console.error(err));
这不是最好的解决方案,但它有效!
检查angular.json文件。对我来说,错误";包已安装";由于angular.json中已经有了相同名称的库。从中删除,我可以在没有任何错误的情况下工作。