【问题标题】:Error: node_modules/@angular/platform-browser/platform-browser.d.ts:44:22 - error NG6002错误:node_modules/@angular/platform-b​​rowser/platform-b​​rowser.d.ts:44:22 - 错误 NG6002
【发布时间】: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
  • 服务一次又一次

家里有医生吗?!

【问题讨论】:

标签: angular


【解决方案1】:

今天我遇到了同样的问题,我尝试了不同的方法,更改了文件所在的父目录之一的目录名称之一,其名称中有一个“#”符号,这导致了问题。

【讨论】:

    猜你喜欢
    • 2018-11-16
    • 2016-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多