How to check dependency of ionic?

Hi there,

In package.json, we have a section “dependencies”, where all version of ionic plugins are listed here.

But, when we install some plugin, keyboard for example, when the native-core version is 3.4.2, if I run cmd ‘npm i @ionic-native/keyboard’, it says that at least native core version 3.6.0 are requested and keyboard version installed is 3.6.1.

So there is a dependency of the plugins indeed.

I tried ‘npm i @ionic-natice/keyboard@3.5.0’ and version 3.4.2 too for native core version 3.4.2 but both are mismatched when run, and I got a fail message of undefined for keyboard variables.

So how can we check the correct dependencies for all the plugin?

It’s really puzzles me, please anyone help, thank you~

Why do you not just update your dependencies in your package.json to the latest native release?

update it there and run npm install after it.

Do you mean I myself to modify all plugin versions to the latest and then run npm i ?

This maybe a option for me, but some of plugins have issues and I do not want to update all to the latest and I do not know which one is the correct one for native core dependency.

What I mean is that is there a way for all of the user to manage all dependencies automatically? Even we just modify one line or little number of lines in package.json file is more acceptable.

Please post your package.json, then we can help you with the versions. You could use
"~MAJOR.MINOR.PATCH" to automatically upgrade to highest PATCH
"^MAJOR.MINOR.PATCH" to automatically upgrade to highest MINOR and PATCH
"*"to automatically upgrade to highest MAJOR, MINOR and PATCH
… with npm install

But it can happen, that your app crashes because of breaking changes. Thats why I recommend to do upgrades manually. But ~ should have very low risk to break something.

Jup. Just change the old version to the actual one and run npm install.

3.6.0 is a major fork in the road here. If you use any native plugins >=3.6.0, you must have core >=3.6.0, because otherwise you are missing the required IonicNativePlugin base class.

1 Like