【发布时间】:2021-04-23 20:56:00
【问题描述】:
打开了一个全新的项目,完全没有改变,当我服务项目时,我收到以下错误:
Error: node_modules/@angular/platform-browser/platform-browser.d.ts:44: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/platform-browser) which declares BrowserModule 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.
44 export declare class BrowserModule {
---------------------------------------------------------------------------------------------------------
我尝试过但不起作用的事情:
- 重新安装 npm
- 将 npm 回滚到早期版本
- 退出 ivy(enableivy=false 和 aot=false)
- 服务 --prod
- 服务一次又一次
家里有医生吗?!
【问题讨论】:
-
可能是重启控制台并再次输入 ng serve
标签: angular