@angular/material/index.d.ts' 不是模块 [英] @angular/material/index.d.ts' is not a module
问题描述
使用 Angular 8,在构建应用程序时,我们遇到以下错误:
With Angular 8, While building the app, we encounter the following error:
app/modules/admin-module/pages/editor/editor.component.ts:6:27 - error TS2306:
File ...node_modules/@angular/material/index.d.ts' is not a module.
推荐答案
更新:请查看下面 Jeff Gilliland 的回答以获取更新的解决方案
好像这个帖子说发布了一个重大更改:
Seems like as this thread says a breaking change was issued:
组件不能再通过@angular/material"导入.用各个次要入口点,例如@角度/材料/按钮.
Components can no longer be imported through "@angular/material". Use the individual secondary entry-points, such as @angular/material/button.
更新:可以确认,这就是问题所在.将@angular/material@9.0...
降级到@angular/material@7.3.2
后,我们可以暂时解决这个问题.猜猜我们需要更新项目以获得长期解决方案.
Update: can confirm, this was the issue. After downgrading @angular/material@9.0...
to @angular/material@7.3.2
we could solve this temporarily. Guess we need to update the project for a long term solution.
这篇关于@angular/material/index.d.ts' 不是模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!