【问题标题】:Why Ionic returns No Provider for File为什么 Ionic 返回 No Provider for File
【发布时间】:2017-09-25 16:01:05
【问题描述】:

在论坛上花了很多时间后,任何提示:

运行时错误 0:0 错误,原因是:没有文件提供程序!

在我的 app.module.ts 中:

....
import { File } from '@ionic-native/file';
....
....
  providers: [
StatusBar,
SplashScreen,
File,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]

在服务提供者中...

@Component({
    providers: [File]
})

应用启动时出现上述错误信息...

将一些更新作为“离子插件添加cordova-plugin-file”但没有...

有什么想法吗?

问候

JL

【问题讨论】:

    标签: cordova typescript ionic2


    【解决方案1】:

    更新离子

    npm uninstall --save @ionic-native/core
    npm install --save @ionic-native/core@latest
    

    【讨论】:

      【解决方案2】:

      就我而言,我必须按照命令安装文件模块:

       npm install --save @ionic-native/file
      

      【讨论】:

        猜你喜欢
        • 2018-08-27
        • 1970-01-01
        • 1970-01-01
        • 2022-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-05-31
        • 1970-01-01
        相关资源
        最近更新 更多