离子性-RXJS错误:rxjs_Observable __。Observable.combine最新不是函数

时间:2018-12-20 15:45:32

标签: angular ionic-framework rxjs yarnpkg

在我的Ionic 3.9应用程序中,在浏览器中运行__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.combineLatest is not a function时出现以下错误:ionic serve

我遇到了插件错误,因此删除了node_modules,yarn.lock,并通过$ yarn install重新安装了所有依赖项。

ERROR TypeError: __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.combineLatest is not a function
    at NgxErrorDirective.ngOnInit (ngxerror.directive.js:40)
    at checkAndUpdateDirectiveInline (core.js:12369)
    at checkAndUpdateNodeInline (core.js:13893)

这是我的配置:

$ ionic info

Ionic:

   ionic (Ionic CLI)  : 4.6.0
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.0.0, browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, (and 5 other plugins)

System:

   Android SDK Tools : 25.2.5 (/home/louisro/android-sdk-linux/)
   NodeJS            : v8.9.4 (/home/louisro/.nvm/versions/node/v8.9.4/bin/node)
   npm               : 5.6.0
   OS                : Linux 4.4

$ yarn install给出了以下内容:

$ yarn install
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
warning angularfire2@5.1.1: AngularFire has moved, we're now @angular/fire
warning cordova-browser > path-is-absolute@2.0.0: This package is no longer relevant as Node.js 0.12 is unmaintained.
warning cordova-plugin-ionic > @types/cordova-plugin-file-transfer@1.6.2: This is a stub types definition for cordova-plugin-file-transfer (https://github.com/apache/cordova-plugin-file-transfer). cordova-plugin-file-transfer provides its own type definitions, so you don't need @types/cordova-plugin-file-transfer installed!
warning @ionic/app-scripts > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @angular/common@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/core@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/forms@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/http@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @ionic-native/camera@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/camera@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/core@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > @ionic-native/email-composer@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/email-composer@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/fcm@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/fcm@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/geolocation@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/geolocation@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/http@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/http@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/push@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/push@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/splash-screen@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > @ionic-native/status-bar@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/compiler@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/common@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/core@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has unmet peer dependency "core-js@^2.4.1".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "zone.js@^0.8.26".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/common@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/core@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/platform-browser@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/platform-browser-dynamic@>=6.0.0 <8".
warning "firebase > @firebase/storage@0.2.4" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/functions@0.3.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/functions > @firebase/messaging-types@0.2.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/storage > @firebase/storage-types@0.2.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/database@0.3.7" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/database > @firebase/database-types@0.3.2" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/auth > @firebase/auth-types@0.5.0" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore@0.9.0" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/messaging@0.3.7" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore > @firebase/firestore-types@0.8.0" has unmet peer dependency "@firebase/app-types@0.x".
warning " > ng2-charts-x@2.0.6" has incorrect peer dependency "rxjs@^5.1.0".
warning " > ng2-charts-x@2.0.6" has unmet peer dependency "moment@^2.18.1".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 72.88s.

2 个答案:

答案 0 :(得分:0)

好像有问题structure(list(individual = 1:9, stage = structure(c(2L, 2L, 2L, 2L, 2L, 3L, 1L, 1L, 1L), .Label = c("adult", "infant", "juvenile" ), class = "factor"), fate = structure(c(2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 1L), .Label = c("adult", "infant", "juvenile"), class = "factor"), fertility = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L)), row.names = c(NA, -9L), class = "data.frame") 。很难假设不看代码,但是如果您导入Observable,则更有可能也需要像这样导入CombineLatest

Observable.combineLatest

希望它能起作用。

答案 1 :(得分:0)

yarn告诉您:您的对等依赖项不正确。

我看到您正在尝试安装需要@angular/fire@5.1.1的{​​{1}}软件包。 这也意味着将所有@angular/common@>=6.0.0@angular/*依赖项升级到6.0.0或更高版本。

您还应该注意,rxjs 6与以前的版本之间有一些重大更改(您的CombineLatest错误可能来自此处)。您还可以安装rxjs来保持代码不变。

希望有帮助。