简体   繁体   English

升级到 angular 9 和 primeng 9 后找不到模块“@angular/core”

[英]Cannot find module '@angular/core' after upgrading to angular 9 and primeng 9

I have upgraded to Angular 9, and updated PrimeNG to verion 9 .我已升级到 Angular 9,并将 PrimeNG 更新到 verion 9 。 After I do ng build, I get the following errors, Cannot find module '@angular/core' in one of primeng library components.执行 ng build 后,出现以下错误,在primeng 库组件之一中找不到模块“@angular/core”。 Both angular and primeng are version 9.0.0, what can be an issue? angular 和 primeng 都是 9.0.0 版本,有什么问题?

在此处输入图片说明

在此处输入图片说明

删除 node_modules 和 package-lock.json 并重复安装

After you upgrade to primeng 9, check your project to see if it has old references to primeng components.升级到 primeng 9 后,请检查您的项目以查看它是否有对 Primeng 组件的旧引用。

As an example please see attached, there are others that you need to change too, just look for them.作为示例,请参见附件,还有其他一些您也需要更改,只需查找它们即可。 Once you give correct reference, it will fix those errors for you.一旦您提供正确的参考,它将为您修复这些错误。 Another example is "growl" is depricated, change it to "toast".另一个例子是“growl”被贬低,改为“toast”。

Also make sure you import primeng modules correctly too.还要确保您也正确导入了primeng 模块。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM