I try to use this in my Ionic 2 application : https://ionicframework.com/docs/v2/storage/
I already run
cordova plugin add cordova-sqlite-storage --
Since Ionic 2.2.0, it's recommended to use @ionic/storage version 2.0.0. Configuration in app.modules.ts has changed since the previous version. The error occurs if you haven't changed everything in the right way.
In app.modules.ts do following changes:
Change import statement:
from: import { Storage } from '@ionic/storage';
to: import { IonicStorageModule } from '@ionic/storage';
Add the following to the imports array:
IonicStorageModule.forRoot()
The import array should look like below:
imports: [
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot()
],
NOTE: Do not make any change in imports of Storage in any other files.