gpt4 book ai didi

TypeScript 错误找不到模块 'angularfire2/interfaces' ionic 3 angularfire2-offline

转载 作者:搜寻专家 更新时间:2023-10-30 21:00:10 25 4
gpt4 key购买 nike

当我想设置 angularfire2-offline 时,我得到这个错误:

[16:02:08]  typescript: node_modules/angularfire2-offline/database/database.d.ts, line: 2 
Cannot find module 'angularfire2/interfaces'.

L1: import { AngularFireDatabase } from 'angularfire2/database';
L2: import { FirebaseListFactoryOpts, FirebaseObjectFactoryOpts } from 'angularfire2/interfaces';
L3: import { AfoListObservable } from './list/afo-list-observable';

[16:02:08] typescript: node_modules/angularfire2-offline/database/interfaces.d.ts, line: 1
Cannot find module 'angularfire2/interfaces'.

L1: import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';

[16:02:08] typescript: node_modules/angularfire2-offline/database/list/afo-list-observable.d.ts, line: 1
Cannot find module 'angularfire2/interfaces'.

L1: import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';
L2: import { ReplaySubject } from 'rxjs/ReplaySubject';

[16:02:08] typescript: node_modules/angularfire2-offline/database/list/emulate-query.d.ts, line: 1
Cannot find module 'angularfire2/interfaces'.

L1: import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';
L2: export declare class EmulateQuery {
app.module.ts 中的

@ngModule:

@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(firebaseConfig),
AngularFireDatabaseModule,
AngularFireOfflineModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}

版本:

  • ionic 3.9.2
  • 命令行界面 3.8
  • angularfire2 4.0.0
  • angularfire2-离线4.2.4
  • Firebase 4.3.0
  • typescript 2.6.0

我正在学习这两个教程:

https://github.com/adriancarriger/angularfire2-offlinehttps://javebratt.com/offline-angularfire2/

突然出现错误。

最佳答案

好像是angularfire2新版本的问题

angularfire2 : 4.0.0-rc.2

我降级到以前的版本,现在一切正常。

npm install angularfire2@4.0.0-rc0

关于TypeScript 错误找不到模块 'angularfire2/interfaces' ionic 3 angularfire2-offline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45842024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com