作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经安装了 FlexLayoutModule
并在遇到此错误时声明了它:
Error: node_modules/@angular/flex-layout/typings/module.d.ts:16:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
This likely means that the library (@angular/flex-layout/typings/module) which declares FlexLayoutModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
16 export declare class FlexLayoutModule {
~~~~~~~~~~~~~~~~
可能出了什么问题?
FlexLayoutModule的版本是11.0.0-beta.33
最佳答案
我也遇到了同样的问题。我通过导入 FlexLayoutModule 而是导入 FlexModule 来修复此问题:
import { FlexModule } from '@angular/flex-layout';
那是我的 package.json:
"dependencies": {
"@angular/animations": "~11.0.5",
"@angular/cdk": "^11.0.3",
"@angular/common": "~11.0.5",
"@angular/compiler": "~11.0.5",
"@angular/core": "~11.0.5",
"@angular/flex-layout": "^11.0.0-beta.33",
"@angular/forms": "~11.0.5",
"@angular/material": "^11.0.3",
"@angular/platform-browser": "~11.0.5",
"@angular/platform-browser-dynamic": "~11.0.5",
"@angular/router": "~11.0.5",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
关于angular - 在 Angular 11 中使用 FlexLayoutModule 会出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65368420/
我已经安装了 FlexLayoutModule 并在遇到此错误时声明了它: Error: node_modules/@angular/flex-layout/typings/module.d.ts:1
我是一名优秀的程序员,十分优秀!