Angular 6和AngularFire2 RxJS错误 [英] Angular 6 and AngularFire2 RxJS Error

查看:65
本文介绍了Angular 6和AngularFire2 RxJS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用AngularFire 2创建一个新的Angular 6应用. 尽管我按照本教程进行操作,但出现版本错误.

I want to create a new Angular 6 App with AngularFire 2. Although I followed the tutorial, I get a version error.

AngularFire2安装指南: https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md

AngularFire2 Setup Tutorial: https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md

即使我只尝试使用本教程中看到的Observable,也遇到以下错误:

Even though I only tried to use an Observable as seen in the tutorial I get the following error:

ERROR in node_modules/angularfire2/angularfire2.d.ts(3,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/angularfire2/firestore/collection/changes.d.ts(3,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/firestore/collection/collection.d.ts(3,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/firestore/document/document.d.ts(3,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/firestore/firestore.d.ts(3,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/firestore/interfaces.d.ts(1,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Subscriber"' has no exported member 'Subscriber'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(2,10): error TS2305: Module '"/Users/tarek/Documents/Development/web_app/apphoven-web/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
node_modules/rxjs/Subscriber.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subscriber'.
node_modules/rxjs/Subscription.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subscription'.

我是否纠正AngularFire 2不支持Angular 6的问题?因为它没有写在任何地方.而且我认为降级到旧的Angular CLI并不是一个好主意...那么,我该怎么办?

Am I correct that AngularFire 2 does not support Angular 6? Because it's not written anywhere. And I don't think it's a good idea to downgrade to the old Angular CLI... So, what can I do?

推荐答案

现在可以使用

npm install --save rxjs-compat

这篇关于Angular 6和AngularFire2 RxJS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆