Angular material 错误"/节点“U模块/cdk表格导出器/cdk-table-exporter.d.ts没有选择器,请添加它”;在构建角度应用程序时

Angular material 错误"/节点“U模块/cdk表格导出器/cdk-table-exporter.d.ts没有选择器,请添加它”;在构建角度应用程序时,angular-material,mat-table,Angular Material,Mat Table,我安装了以下依赖项,仅用于在angular 8中使用mat table exporter: npm install mat-table-exporter --save 现在,当我使用以下命令构建角度应用程序时: ng build --prod --build-optimizer --aot --base-href=/application_base_name 我得到如下所示的错误: PS C:\GitRepositories\cricket_aiops_dashboard\Client_S

我安装了以下依赖项,仅用于在angular 8中使用mat table exporter:

npm install mat-table-exporter --save 
现在,当我使用以下命令构建角度应用程序时:

ng build --prod --build-optimizer --aot --base-href=/application_base_name
我得到如下所示的错误:

PS C:\GitRepositories\cricket_aiops_dashboard\Client_Side>ng build --prod --build-optimizer --aot --base-href=/application_base_name
Your global Angular CLI version (9.1.0) is greater than your local
version (8.3.26). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

ERROR in Directive CdkTableExporter in C:/../Client_Side/node_modules/cdk-table-exporter/cdk-table-exporter.d.ts has no selector, please add it!
我试图通过安装dependency:npm install——保存cdk表导出器,然后构建我的应用程序来解决这个问题,但即使在那个时候它也不起作用

请查找package.json的以下内容

{
  "name": "ai-ops",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config proxy.conf.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.2.14",
    "@angular/cdk": "8.2.3",
    "@angular/cli": "^8.3.26",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@ng-bootstrap/ng-bootstrap": "^5.3.0",
    "@syncfusion/ej2-angular-calendars": "^17.4.51",
    "@syncfusion/ej2-vue-calendars": "^17.4.51",
    "@types/jquery": "^3.3.31",
    "angular-google-charts": "^0.1.6",
    "angular2-datatable": "^0.6.0",
    "angular2-datatable-pagination": "0.0.3",
    "angular2-prettyjson": "^3.0.1",
    "bootstrap": "^4.4.1",
    "core-js": "^2.6.11",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.5.0",
    "mat-table-exporter": "^9.0.0",
    "ng-multiselect-dropdown": "^0.2.10",
    "ngx-json-viewer": "^2.4.0",
    "ngx-toastr": "^11.2.1",
    "popper.js": "^1.16.1",
    "rxjs": "^6.5.3",
    "rxjs-compat": "^6.5.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.26",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.1",
    "jasmine-core": "~2.99.1",
    "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": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.3",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.5.3"
  }
}

请帮忙

如果您使用的是低于9的角度版本,则应使用mat table-exporter@1.2.5. 使用此->npm安装--保存mat表-exporter@1.2.5

如果已安装mat table exporter,请卸载它。 首先卸载mat表导出器,然后卸载cdk表导出器。 然后安装垫台-exporter@1.2.5使用上述命令

来源-


希望这会有帮助,干杯

如果您使用的是低于9的角度版本,则应使用mat table-exporter@1.2.5. 使用此->npm安装--保存mat表-exporter@1.2.5

如果已安装mat table exporter,请卸载它。 首先卸载mat表导出器,然后卸载cdk表导出器。 然后安装垫台-exporter@1.2.5使用上述命令

来源-


希望这会有帮助,干杯

检查您的角度版本,如果低于9,请使用mat table-exporter@1.2.5


npm安装--保存mat表-exporter@1.2.5

检查您的角度版本,如果低于9,请使用垫表-exporter@1.2.5


npm安装--保存mat表-exporter@1.2.5

我从这个链接得到了答案:我从这个链接得到了答案:顺便说一句,你甚至不需要卸载,我只是运行了npm安装--保存mat表-exporter@1.2.5如果不卸载以前的版本并修复它:)顺便说一句,你甚至不需要卸载,我刚刚运行了npm安装--保存mat表-exporter@1.2.5没有卸载以前的版本,并且已修复:)