node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'. for...

Discussão em 'Angular' iniciado por user1169587, Outubro 23, 2024.

  1. user1169587

    user1169587 Guest

    I follow the tutorial in https://v8.angular.io/tutorial/toh-pt6, when I run npm start, many error come from node_modules/angular-in-memory-web-api/index.d.ts, like follows:


    ERROR in node_modules/angular-in-memory-web-api/index.d.ts:38:19 - error TS1086: An accessor cannot be declared in an ambient context.

    38 protected get dbReady(): Observable; ~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:264:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

    264 static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientBackendService, [null, { optional: true; }, null]>; ~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:265:22 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectableDeclaration'.

    265 static ɵprov: i0.ɵɵInjectableDeclaration; ~~~~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:297:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

    297 static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientInMemoryWebApiModule, never>; ~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:298:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.

    298 static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientInMemoryWebApiModule, never, never, never>; ~~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:299:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.

    299 static ɵinj: i0.ɵɵInjectorDeclaration; ~~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:312:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

    312 static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryBackendConfig, never>; ~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:313:22 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectableDeclaration'.

    313 static ɵprov: i0.ɵɵInjectableDeclaration; ~~~~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:428:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

    428 static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryWebApiModule, never>; ~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:429:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.

    429 static ɵmod: i0.ɵɵNgModuleDeclaration<InMemoryWebApiModule, never, never, never>; ~~~~~~~~~~~~~~~~~~~~~ node_modules/angular-in-memory-web-api/index.d.ts:430:21 - error TS2694: Namespace '"{path}/angular-tour-of-heroes/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.

    430 static ɵinj: i0.ɵɵInjectorDeclaration; ~~~~~~~~~~~~~~~~~~~~~
    ​

    the dependencies/devDependencies section of my package.json is as follow:

    "dependencies": {
    "@angular/animations": "~8.2.14",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/http": "^7.2.16",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "angular-in-memory-web-api": "^0.18.0",
    "rxjs": "~6.4.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
    },
    "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.25",
    "@angular/cli": "~8.3.26",
    "@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"
    }


    how to fix these error?

    Continue reading...

Compartilhe esta Página