FTP 插件上的 Ionic 4 plugin_not_installed

Ionic 4 plugin_not_installed on FTP plugin

我正在使用 ionic 4ftp 插件。

这是我的应用程序模块:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

import { FTP } from '@ionic-native/ftp/ngx';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [
    StatusBar,
    SplashScreen,
    FTP,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

那么这是我的home.page.html:

<ion-header>
  <ion-toolbar>
    <ion-title>
      Ionic Blank
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <div class="ion-padding">

    <h2>{{ title }}</h2>

  <div>
  <h4>Success Message: {{ successMessage }}</h4>
  </div>
  <hr>
  <div>
    <h4>Fail Message: {{ failMessage }}</h4>
    </div>

    The world is your oyster.
    <p>If you get lost, the <a target="_blank" rel="noopener" href="https://ionicframework.com/docs/">docs</a> will be your guide.</p>
  </div>
</ion-content>

最后是我的 home.page.ts:

import { Component } from '@angular/core';
import { FTP } from '@ionic-native/ftp/ngx';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  title = 'Test';
  successMessage = '';
  failMessage = '';

  constructor(private ftp: FTP) {

  this.ftp.connect('ftp_host', 'ftp_user', 'ftp_password')
  .then((res: any) => {
    console.log('Login successful', res);
    this.successMessage = `Login successful - ${res}`;
  })
  .catch((error: any) => {
    console.error(error);
    this.failMessage = `Error - ${error}`;
  });


  }

}

问题是,当我 运行 这个(运行 在 IOS / Xcode SimulatorDevice 上也一样)。 我已经尝试 运行ning 准备更新,但同样的错误仍然存​​在。 我不断收到:

Error - plugin_not_installed.

我该如何解决这个问题?有什么想法吗?

您需要安装此插件

ionic cordova plugin add cordova-plugin-ftp
npm install @ionic-native/ftp

如果您已经安装了此插件,请删除 node modulesplatforms 并重新安装 node modules 并添加 platforms