2

angular 8 プロジェクトがあり、angular Ivy を有効にすると、コンパイル時に失敗します。他の人が提供し、Angular 8.1.0 (8.0.3 から) に更新されたソリューションを確認しても、問題は解決せず、以下のエラーが表示され続けます。

D:\Users\Backup>ng build shared
Building Angular Package
Building entry point 'shared'
Compiling TypeScript sources through ngc

BUILD ERROR
node_modules/@angular/common/common.d.ts(115,22): error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
node_modules/@angular/forms/forms.d.ts(2669,22): error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
node_modules/@angular/forms/forms.d.ts(3703,22): error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
node_modules/@angular/common/http/http.d.ts(2799,22): error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class

私の Angular Ivy は tsconfig.app.json で有効になっています。

"angularCompilerOptions": {
    "enableIvy": true
  }

私の package.json には次の依存関係があります。

"dependencies": {
    "@angular/animations": "~8.0.3",
    "@angular/common": "~8.0.3",
    "@angular/compiler": "~8.0.3",
    "@angular/core": "~8.0.3",
    "@angular/forms": "~8.0.3",
    "@angular/material": "^8.0.1",
    "@angular/platform-browser": "~8.0.3",
    "@angular/platform-browser-dynamic": "~8.0.3",
    "@angular/platform-server": "~8.0.3",
    "@angular/router": "~8.0.3",
    "@ng-bootstrap/ng-bootstrap": "^5.0.0-rc.0",
    "@nguniversal/express-engine": "^7.1.1",
    "@nguniversal/module-map-ngfactory-loader": "0.0.0",
    "@nicky-lenaers/ngx-scroll-to": "^2.0.0",
    "@swimlane/ngx-charts": "^11.1.0",
    "@types/googlemaps": "^3.36.5",
    "core-js": "^2.5.4",
    "express": "^4.15.2",
    "ngx-cookie-service": "^2.2.0",
    "ngx-typeahead": "^6.2.0",
    "rxjs": "~6.5.2",
    "systemjs": "3.0.2",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.6",
    "@angular-devkit/build-ng-packagr": "~0.800.6",
    "@angular/cli": "~8.0.6",
    "@angular/compiler-cli": "~8.0.3",
    "@angular/language-service": "~8.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.1",
    "jasmine": "^3.3.1",
    "jasmine-core": "^3.3.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "ng-packagr": "^5.1.0",
    "prettier": "^1.16.4",
    "tsickle": ">=0.34.0",
    "ts-loader": "^5.2.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5",
    "webpack-cli": "^3.1.0"
  }

上記の問題を解決する方法を教えてください。

4

2 に答える 2