我正在尝试为我的Angular 6应用程序添加Firebase支持,但是在添加angularfire2时遇到了问题。
npm install angularfire2 firebase
我经常收到警告,说我必须使用Angular 5。例如:
npm WARN angularfire2@5.0.0-rc.6.0 requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
今天能否在Angular 6中使用angularfire2?
编译时我收到了以下错误信息:
ERROR in node_modules/angularfire2/angularfire2.d.ts(3,10): error TS2305: Module '"/home/rrr/Projects/ng6test/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2720: Class 'FirebaseApp' incorrectly implements class 'FirebaseApp'. Did you mean to extend 'FirebaseApp' and inherit its members as a subclass?
Property 'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'.
node_modules/rxjs/Subscription.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subscription'.
我试图安装rxjs-compat,但是之后我收到了另一个警告。
ERROR in node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2720: Class 'FirebaseApp' incorrectly implements class 'FirebaseApp'. Did you mean to extend 'FirebaseApp' and inherit its members as a subclass?
Property 'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'.