执行 Angular 命令时出错 - ng serve

Error while executing Angular command - ng serve

我已将我的 Angular 项目升级到 v10。在执行 ng serve 时,我收到以下错误消息

ERROR in node_modules/angular4-multiselect-dropdown/dist/multiselect.component.d.ts:72: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 (angular4-multiselect-dropdown/angular4-multiselect-dropdown) which declares AngularMultiSelectModule 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.

我使用以下命令安装了 angular4-multiselect-dropdown

npm install angular4-multiselect-dropdown@latest

我的包裹如下所示

{
  "name": "ng4",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build-prod": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ngcc"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/schematics": "0.0.34",
    "@angular/animations": "9.1.13",
    "@angular/cdk": "^10.2.7",
    "@angular/common": "10.2.5",
    "@angular/compiler": "10.2.5",
    "@angular/core": "10.2.5",
    "@angular/forms": "^10.2.5",
    "@angular/http": "4.4.5",
    "@angular/platform-browser": "^10.2.5",
    "@angular/platform-browser-dynamic": "9.1.13",
    "@angular/router": "9.1.13",
    "@ngrx/core": "1.2.0",
    "@ngrx/effects": "^10.1.2",
    "@ngrx/store": "^10.1.2",
    "@types/lodash": "4.14.85",
    "angular-sanitize": "^1.8.0",
    "angular4-multiselect-dropdown": "^2.0.0",
    "bootstrap": "^3.4.1",
    "classlist.js": "1.1.20150312",
    "core-js": "2.4.1",
    "decode-html": "^2.0.0",
    "font-awesome": "4.7.0",
    "immutable": "3.8.2",
    "jquery": "3.2.1",
    "lodash": "4.17.4",
    "moment": "2.20.1",
    "ngx-bootstrap": "^6.2.0",
    "ngx-logger": "^4.2.1",
    "rxjs": "6.6.2",
    "rxjs-compat": "^6.6.7",
    "tslib": "^2.0.0",
    "zone.js": "^0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1002.3",
    "@angular/cli": "^10.2.3",
    "@angular/compiler-cli": "10.2.5",
    "@angular/language-service": "10.2.5",
    "@types/jasmine": "2.5.53",
    "@types/jasminewd2": "2.0.2",
    "@types/jquery": "3.2.16",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "3.2.0",
    "tslint": "~6.1.0",
    "typescript": "^3.9.2"
  }
}

将 multiselect 替换为 material select 以及参数“multiple”,或者尝试为 what

创建自己的模块

angular4-multiselect-dropdown 与 angular ivy 引擎不兼容