Angular 7 - Excel download

Discussão em 'Angular' iniciado por SK., Maio 14, 2025.

  1. SK.

    SK. Guest

    We have an existing project, it was developed in Angular 7. I am trying to use Excel Download using xls (https://www.npmjs.com/package/xlsx) or mat-table-exporter (https://www.npmjs.com/package/mat-table-exporter). When I see examlpes in stackblitz, I feel like xls is more suitable for my. It atches almost what code we have right now.

    Now the problem is, when I am trying to install xls, it throws error. Here I am providing our package.json and what error I am getting.

    Any help please...

    Existing package.json


    "dependencies": {
    "@angular/animations": "^7.2.16",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^7.2.16",
    "@angular/compiler": "^7.2.16",
    "@angular/core": "^7.2.16",
    "@angular/flex-layout": "^7.0.0-beta.24",
    "@angular/forms": "^7.2.16",
    "@angular/material": "^7.3.7",
    "@angular/material-moment-adapter": "^8.2.3",
    "@angular/platform-browser": "^7.2.16",
    "@angular/platform-browser-dynamic": "^7.2.16",
    "@angular/router": "^7.2.16",
    "@schematics/angular": "^7.3.10",
    "angular-datatables": "^7.0.0",
    "core-js": "^2.5.4",
    "datatables.net": "^1.13.2",
    "datatables.net-dt": "^1.13.2",
    "file-saver": "^2.0.5",
    "hammerjs": "^2.0.8",
    "handlebars": "^4.7.7",
    "jquery": "^3.6.0",
    "js-yaml": "^3.14.1",
    "jsplumb": "^2.15.5",
    "mat-select-autocomplete": "^1.3.0",
    "moment": "^2.29.4",
    "ng-circle-progress": "^1.6.0",
    "ng-multiselect-dropdown": "0.2.14",
    "ngx-bootstrap": "^5.6.2",
    "ngx-cookie-service": "^2.4.0",
    "ngx-infinite-scroll": "^8.0.2",
    "ngx-mat-select-search": "^1.8",
    "primeicons": "1.0.0-beta.10",
    "primeng": "^7.1.3",
    "rxjs": "^6.5.5",
    "rxjs-compat": "^6.6.7",
    "tslib": "^1.14.1",
    "zone.js": "~0.8.26"


    },

    Command:

    npm i xlsx


    Error:

    npm error code ERESOLVE
    npm error ERESOLVE could not resolve
    npm error
    npm error While resolving: @angular/material-moment-adapter@8.2.3
    npm error Found: @angular/core@7.2.16
    npm error node_modules/@angular/core
    npm error peer @angular/core@"7.2.16" from @angular/animations@7.2.16
    npm error node_modules/@angular/animations
    npm error peer @angular/animations@">=7.0.0" from @angular/material@7.3.7
    npm error node_modules/@angular/material
    npm error peer @angular/material@"^7.3.3" from mat-select-autocomplete@1.3.0
    npm error node_modules/mat-select-autocomplete
    npm error mat-select-autocomplete@"^1.3.0" from the root project
    npm error 3 more (mat-table-exporter, ngx-mat-select-search, the root project)
    npm error @angular/animations@"^7.2.16" from the root project
    npm error peer @angular/core@">=7.0.0" from @angular/cdk@7.3.7
    npm error node_modules/@angular/cdk
    npm error peer @angular/cdk@"^7.0.0-rc.0" from @angular/flex-layout@7.0.0-beta.24
    npm error node_modules/@angular/flex-layout
    npm error @angular/flex-layout@"^7.0.0-beta.24" from the root project
    npm error peer @angular/cdk@"7.3.7" from @angular/material@7.3.7
    npm error node_modules/@angular/material
    npm error peer @angular/material@"^7.3.3" from mat-select-autocomplete@1.3.0
    npm error node_modules/mat-select-autocomplete
    npm error mat-select-autocomplete@"^1.3.0" from the root project
    npm error 3 more (mat-table-exporter, ngx-mat-select-search, the root project)
    npm error 4 more (cdk-table-exporter, mat-select-autocomplete, ...)
    npm error 16 more (@angular/common, @angular/flex-layout, @angular/forms, ...)
    npm error
    npm error Could not resolve dependency:
    npm error peer @angular/core@"^8.0.0 || ^9.0.0-0" from @angular/material-moment-adapter@8.2.3
    npm error node_modules/@angular/material-moment-adapter
    npm error @angular/material-moment-adapter@"^8.2.3" from the root project
    npm error
    npm error Conflicting peer dependency: @angular/core@9.1.13
    npm error node_modules/@angular/core
    npm error peer @angular/core@"^8.0.0 || ^9.0.0-0" from @angular/material-moment-adapter@8.2.3
    npm error node_modules/@angular/material-moment-adapter
    npm error @angular/material-moment-adapter@"^8.2.3" from the root project
    npm error
    npm error Fix the upstream dependency conflict, or retry
    npm error this command with --force or --legacy-peer-deps
    npm error to accept an incorrect (and potentially broken) dependency resolution.

    Continue reading...

Compartilhe esta Página