Cant import NativeStorage


I am trying to use NativeStorage library but cant see to get it to work.

I already types “ionic plugin add cordova-plugin-nativestorage” in Terminal under my project directory.

But import {NativeStorage} from ‘ionic-native’; still seems not recognising NativeStorage.

Does anyone know how to get it to work in my project?


Thanks for the reply.

How do I check which version I am using?

I tried typing the update command as you suggested. I got two warnings

npm WARN EPACKAGEJSON tutorial@ No repository field.
npm WARN EPACKAGEJSON tutorial@ No license field.

Is this a problem?

My existing project still cannot find NativeStorage. I get:

'Module ‘"/Users/mat/Documents/projects/tutorial/node_modules/ionic-native/dist/index"’ has no exported member ‘NativeStorage’."

Do I need to do anything else to my existing project?


You can check your package.json at the root of your project. Find ionic-native to check the version.

I don’t know the meaning of this warnings, but it’s just warnings, not errors, so your app should work.

Try to stop ionic run/server and start again so that the new plugin can be recognized.

I don’t used NativeStorage yet, just imported it. I used SQLStorage and SQLite. As it looks to be based on SQLite it should be all what you need. From now just follow the documentation of NatifeStorage.

Thanks, it worked after i restarted Visual Studio Code.