0

我已经为浏览器超时安装了 ng-idle。该功能工作正常,没有编译错误,但此错误显示 ERROR in ../node_modules/@ng-idle/core/lib/eventtargetinterruptsource.d.ts(29,9): error TS1086: An accessor cannot be declared in an环境语境。 安装的软件包是: npm install --save @ng-idle/core @ng-idle/keepalive angular2-moment

下面是我的 package.json

{
    "name": "support",
    "version": "0.0.0",
    "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "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/common": "~8.2.14",
        "@angular/compiler": "~8.2.14",
        "@angular/core": "~8.2.14",
        "@angular/flex-layout": "^8.0.0-beta.26",
        "@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": "^6.1.0",
        "@ng-idle/core": "^10.0.0-beta.1",
        "@ng-idle/keepalive": "^10.0.0-beta.1",
        "ag-grid-angular": "^22.1.1",
        "ag-grid-community": "^22.1.1",
        "angular2-moment": "^1.9.0",
        "bootstrap": "^4.4.1",
        "hammerjs": "^2.0.8",
        "ng-connection-service": "^1.0.4",
        "ngx-bootstrap": "^2.0.5",
        "rxjs": "~6.4.0",
        "saturn-datepicker": "^8.0.5",
        "tslib": "^1.10.0",
        "zone.js": "~0.9.1"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "~0.803.24",
        "@angular/cli": "~8.3.24",
        "@angular/compiler-cli": "~8.2.14",
        "@angular/language-service": "~8.2.14",
        "@types/node": "~8.9.4",
        "@types/jasmine": "~3.3.8",
        "@types/jasminewd2": "~2.0.3",
        "codelyzer": "^5.0.0",
        "jasmine-core": "~3.4.0",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "~4.1.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",
        "protractor": "~5.4.0",
        "ts-node": "~7.0.0",
        "tslint": "~5.15.0",
        "typescript": "~3.5.3"
    }
}

请帮我删除这个错误

4

1 回答 1

1

我遇到了同样的问题。

删除这些版本,然后安装这些版本:

npm install @ng-idle/core@8.0.0-beta.4 @ng-idle/keepalive@8.0.0-beta.4

这应该可以解决问题。为我工作。

于 2020-10-16T14:01:59.933 回答