0

我已将我的项目从 angular 4.4 升级到 8 运行ng serve应用程序时一切正常。

但是当我运行命令ng build --prod它给了我以下错误

C:/code base/latitude-angular-upgrade-v3/node_modules/highcharts-angular/highcharts-angular.d.ts 中类型 HighchartsChartComponent 中的错误是 2 个模块声明的一部分: C:/code base/latitude 中的 MaterialModule -angular-upgrade-v3/src/app/material.module.ts 和 C:/code base/latitude-angular-upgrade-v3/node_modules/highcharts-angular/highcharts-angular.d.ts 中的 HighchartsChartModule!请考虑将 C:/code base/latitude-angular-upgrade-v3/node_modules/highcharts-angular/highcharts-angular.d.ts 中的 HighchartsChartComponent 移动到在 C:/code base/latitude-angular- 中导入 MaterialModule 的更高模块C:/code base/latitude-angular-upgrade-v3/node_modules/highcharts-angular/highcharts-angular.d.ts 中的 upgrade-v3/src/app/material.module.ts 和 HighchartsChartModule。

我尝试将 HighchartsChartComponent 移动到更高的模块,但它什么也没做。下面是我的 package.json 供参考

     {
      "name": "prep-ui",
      "version": "0.18.0",
      "license": "MIT",
      "scripts": {
        "ng": "ng",
        "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve",
        "build": "set NODE_OPTIONS=--max_old_space_size=4096 && ng build --prod",
        "build_major": "webpack --env.major",
        "build_minor": "webpack --env.minor",
        "test": "karma start ./karma.conf.js",
        "lint": "ng lint",
        "e2e": "protractor ./protractor.conf.js",
        "pree2e": "webdriver-manager update --standalone false --gecko false --quiet",
        "build_prod_major:prod": "npm run build_major --env.NODE_ENV=production",
        "build:dev": "npm run build_minor --env.NODE_ENV=development",
        "build:prod": "npm run build_minor --env.NODE_ENV=production",
        "build:aws-dev": "npm run build_minor --env.NODE_ENV=aws-dev",
        "build:aws-qa": "npm run build_minor --env.NODE_ENV=aws-qa",
        "build:aws-stg": "npm run build_minor --env.NODE_ENV=aws-stg",
        "build:aws-prep-uat": "npm run build_minor --env.NODE_ENV=aws-prep-uat",
        "build:aws-prod-irmr-dev": "npm run build_minor --env.NODE_ENV=aws-prod-irmr-dev",
        "build:irmr-prod": "npm run build_minor --env.NODE_ENV=irmr-prod",
        "build:irmr-uat": "npm run build_minor --env.NODE_ENV=irmr-uat",
        "build:latitude-dev": "npm run build_minor --env.NODE_ENV=latitude-dev"
      },
      "private": true

,
       "dependencies": {
        "@angular-builders/custom-webpack": "^9.0.0",
        "@angular/animations": "^8.1.1",
        "@angular/cdk": "^8.1.0",
        "@angular/common": "^8.1.1",
        "@angular/compiler": "^8.2.14",
        "@angular/core": "^8.1.1",
        "@angular/flex-layout": "^8.0.0-beta.26",
        "@angular/forms": "^8.1.1",
        "@angular/material": "^8.0.2",
        "@angular/platform-browser": "^8.1.1",
        "@angular/platform-browser-dynamic": "^8.1.1",
        "@angular/router": "^8.1.1",
        "@ng-bootstrap/ng-bootstrap": "^5.2.1",
        "@ngtools/webpack": "^1.8.0",
        "@ngx-translate/core": "^11.0.0",
        "@ngx-translate/http-loader": "^4.0.0",
        "@types/highcharts": "5.0.27",
        "@types/jquery": "^3.3.6",
        "@types/jsdom": "^12.2.4",
        "@types/knockout": "^3.4.54",
        "@types/lodash": "^4.14.136",
        "@types/parse5": "^5.0.1",
        "angular-calendar": "^0.28.2",
        "angular-highcharts": "^4.1.0",
        "angular2-http-file-upload": "^1.0.6",
        "bootstrap": "^4.4.1",
        "childnode-remove": "^1.0.1",
        "classlist.js": "^1.1.20150312",
        "core-js": "^2.4.1",
        "date-fns": "^2.9.0",
        "file-saver": "^1.3.3",
        "google-libphonenumber": "^3.2.3",
        "hammerjs": "^2.0.8",
        "highcharts": "^5.0.14",
        "highcharts-angular": "^2.4.0",
        "html-loader": "^0.5.5",
        "html-webpack-externals-plugin": "^3.8.0",
        "inputmask": "^4.0.8",
        "intl-tel-input": "^12.1.5",
        "jquery": "^3.4.1",
        "jquery-bar-rating": "^1.2.2",
        "libphonenumber-js": "^0.4.48",
        "lodash": "^4.17.15",
        "moment": "^2.24.0",
        "moment-timezone": "^0.5.14",
        "ng-sidebar": "^6.0.2",
        "ng2-completer": "^1.6.3",
        "ng2-nouislider": "^1.7.7",
        "ng2-table": "^1.3.2",
        "ngx-bootstrap": "^5.3.2",
        "ngx-filter-pipe": "^1.0.0",
        "ngx-order-pipe": "^1.0.3",
        "ngx-select-dropdown": "^0.7.0",
        "ngx-select-ex": "^3.5.2-ng4",
        "ngx-webstorage": "^4.0.1",
        "nouislider": "^9.2.0",
        "print-js": "^1.0.47",
        "rxjs": "^6.5.2",
        "rxjs-compat": "^6.0.0-rc.0",
        "select2": "^4.0.6-rc.1",
        "showdown": "^1.7.5",
        "source-map": "^0.5.7",
        "survey-angular": "^1.0.75",
        "survey-knockout": "^1.0.75",
        "surveyjs-widgets": "^1.0.75",
        "ts-loader": "^6.2.1",
        "tslib": "^1.9.0",
        "webpack-cli": "^3.3.6",
        "webpack-war-plugin": "^1.0.0-beta.3",
        "wnumb": "^1.1.0",
        "zone.js": "~0.9.1"   },   "devDependencies": {
        "@angular-devkit/build-angular": "^0.803.23",
        "@angular/cli": "^8.1.1",
        "@angular/compiler-cli": "^8.1.1",
        "@angular/language-service": "^8.1.1",
        "@ngui/scrollable": "^0.9.1",
        "@types/highcharts": "^5.0.5",
        "@types/jasmine": "~2.5.53",
        "@types/jasminewd2": "~2.0.2",
        "@types/knockout": "^3.4.53",
        "@types/node": "~6.0.60",
        "autoprefixer": "^6.5.3",
        "circular-dependency-plugin": "^3.0.0",
        "clean-webpack-plugin": "^0.1.16",
        "codelyzer": "^5.0.1",
        "copy-webpack-plugin": "^4.2.3",
        "css-loader": "^3.4.2",
        "cssnano": "^3.10.0",
        "exports-loader": "^0.6.3",
        "file-loader": "^0.10.0",
        "grunt-contrib-copy": "^1.0.0",
        "grunt-typescript": "^0.8.0",
        "html-webpack-plugin": "^3.2.0",
        "istanbul-instrumenter-loader": "^2.0.0",
        "jasmine-core": "~2.6.2",
        "jasmine-spec-reporter": "~4.1.0",
        "karma": "~1.7.0",
        "karma-chrome-launcher": "~2.1.1",
        "karma-cli": "~1.0.1",
        "karma-coverage-istanbul-reporter": "^1.2.1",
        "karma-jasmine": "~1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "less-loader": "^4.0.5",
        "postcss-loader": "^3.0.0",
        "postcss-url": "^5.1.2",
        "protractor": "~5.1.2",
        "raw-loader": "^0.5.1",
        "sass-loader": "^6.0.3",
        "script-loader": "^0.7.0",
        "source-map-loader": "^0.2.0",
        "style-loader": "^0.13.2",
        "stylus-loader": "^3.0.1",
        "ts-node": "~3.2.0",
        "tslint": "^5.18.0",
        "typescript": "3.4.5",
        "uglifyjs-webpack-plugin": "^0.4.6",
        "url-loader": "^0.5.7",
        "webpack-auto-inject-version": "^1.2.2",
        "webpack-dev-server": "~3.7.2"   }
}
4

1 回答 1

0

你试过 npm rebuild --force 吗?

您还需要将旧库更新为 8.0 angular

我认为您需要将材料库更新到 8.2.3

于 2020-03-04T10:50:03.950 回答