@ angular/material/index.d.ts'不是一个模块 [英] @angular/material/index.d.ts' is not a module

查看:628
本文介绍了@ angular/material/index.d.ts'不是一个模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用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"导入组件.使用 各个辅助入口点,例如 @ angular/material/button.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆