当前位置: 首页 > 知识库问答 >
问题:

node_modules/@ngrx/core/src/operator/enterzone.d.ts(1,10)中的错误:ngrx存储

左丘宜然
2023-03-14

我在导入storemodule.providestore({counter:todos})时遇到了以下问题;

node_modules/@ngrx/core/src/operator/enterzone.d.ts(1,10)中的错误:错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/operator”没有导出成员“operator”。node_modules/@ngrx/core/src/operator/enterzone.d.ts(2,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/subscriber”没有导出成员“subscriber”。node_modules/@ngrx/core/src/operator/enterzone.d.ts(3,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/observable”没有导出成员“observable”。node_modules/@ngrx/core/src/operator/leavezone.d.ts(1,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/operator”没有导出成员“operator”。node_modules/@ngrx/core/src/operator/leavezone.d.ts(2,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/subscriber”没有导出成员“subscriber”。node_modules/@ngrx/core/src/operator/leavezone.d.ts(3,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/observable”没有导出成员“observable”。node_modules/@ngrx/core/src/operator/select.d.ts(1,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/observable”没有导出成员“observable”。node_modules/@ngrx/store/src/dispatcher.d.ts(1,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/BehaviorSubject”没有导出成员“BehaviorSubject”。node_modules/@ngrx/store/src/ng2.d.ts(1,10):错误TS2305:模块“e:/work/nrgx-store2/my-dream-app/node_modules/@angull/core/core”没有导出成员“opaqueToken”。node_modules/@ngrx/store/src/reducer.d.ts(1,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/BehaviorSubject”没有导出成员“BehaviorSubject”。node_modules/@ngrx/store/src/state.d.ts(1,10):错误TS2305:Module“e:/work/nrgx-store2/my-dream-app/node_modules/rxjs/BehaviorSubject”没有导出成员“BehaviorSubject”。

  @NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    StoreModule.provideStore({ counter: todos })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

package.log

    {
  "name": "my-dream-app",
  "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": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@ngrx/core": "^1.2.0",
    "@ngrx/store": "^2.2.3",
    "core-js": "^2.5.4",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.6",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "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.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  }
}

共有1个答案

花阳秋
2023-03-14

这些都是RXJS的依赖项。我看到您在包JSON中列出了它。试跑

npm install rxjs
 类似资料:
  • ngrx Style Guide Purpose The idea for this styleguide is to present commonly used techniques for working with ngrx suite and serve as a kind of a cookbook/recipes with a problem/solution theme. The pu

  • NGRX Actions Actions/reducer utility for NGRX. It provides a handful of functions to make NGRX/Redux more Angular-tastic. @Store(MyInitialState): Decorator for default state of a store. @Action(...MyA

  • What is Ngrx?

  • Angular ngrx-data This repository is now merged with @ngrx into @ngrx/data. You can find the ngrx/data docs here and the github repository with ngrx/data in it here Please read the note above Zero Ngr

  • This repository is no longer maintained, please refer to https://github.com/avatsaev/angular-contacts-app-example Angular Ngrx Socket.IO Example This Angular project demonstrates the implementation of

  • Angular 12, NgRx and Angular Material Starter by @tomastrajan Table of Content Live Demo Getting Started Useful Commands Make It Your Own Goals Learning Materials List of Projects Built Using This Sta