Fixing the IonicNativePlugin error

April 30, 2017, 12:21 pm Categories:


One thing is guaranteed as a developer - You WILL encounter bugs.

It seems to be an unviolable law of software development - no matter how basic or complex the code might be.

For example, I recently received an email from a reader concerning the following error they kept experiencing while trying to build their project using Ionic Native plugins:

Module 'node_modules/@ionic-native/core/index' has no exported member 'IonicNativePlugin'

Hmm, not the kind of result you'd expect so I was curious to see if I could replicate this.

Within 5 minutes I'd created a sample project, installed a couple of Ionic Native plugins, begun a build process and sure enough.....I was greeted with the exact same error.

Definitely NOT good.

Thankfully fixing this is pretty straightforward - simply upgrade the @ionic-native/core dependency to the latest version.

To do this you'll need to run the following in your command line utility:

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

This will then update the @ionic-native/core entry in your package.json file.

Alternatively you can simply edit the value for the @ionic-native/core entry to the one shown below:

"@ionic-native/core": "^3.6.1",

Then return back to the command line and run the following to install this version of the @ionic-native/core package:

npm install

Either way seems to work fine from my own experiments.

With @ionic-native/core now updated I was able to build/run my application(s) without experiencing that particular error again.

In Summary

Even as great and user friendly as the Ionic framework is the fact that there's constant development and upgrades to the software pretty much guarantees issues like the above will be encountered.

Thankfully resolving this particular issue was fairly simple and straightforward thanks to the Node package manager and a little command line work.

If only software bugs were always that simple to fix!

I hope you found this article useful and please feel free to share your thoughts, findings or suggestions in the comment section below.

If you enjoyed what you've read here then please sign up to my mailing list and, if you haven't done so already, take a look at my e-book: Mastering Ionic for further information about troubleshooting errors and issues while developing with Ionic.



Post a comment

All comments are welcome and the rules are simple - be nice and do NOT engage in trolling, spamming, abusiveness or illegal behaviour. If you fail to observe these rules you will be permanently banned from being able to comment.