Package.json

I have half a dozen or so plugins installed in my app but they do not appear in my package.json file in the “cordovaPlugins” section. Some plugins appear there but many are missing. This is what I have in there:

“cordovaPlugins”: [
“cordova-plugin-console”,
“cordova-plugin-whitelist”,
“cordova-plugin-device”,
“cordova-plugin-splashscreen”
],

I would have thought they would all be listed in there? (btw they all appear in the android.json and ios.jsn files in the plugins folder).

If they are supposed to appear in package.json then how do I get this file to update correctly? (and if they should be in there, why aren’t they?)

I may be wrong but I think only recent versions of ionic cli started to include plugins into package.json. Did you install these plugins long time ago? As for updating, I think the only way to update cordova plugin is to rm and then add it again.

Hi. Thanks. I have been working on this project for the last 6-8 weeks and have bee adding plugins throughout that time. The app works fine so they are included ok. However, today I tried to use the new Package service and the build that I downloaded seemed too small - I wonder if its due to these plugins not being in my package.json file ? I have removed and added plugins several times so its obviously not updating that file correctly.

I wonder if there is a difference between cordova plugin add ** and ionic plugin add **

1 Like

Hmm, maybe. Thanks, I will investigate.

You’re right! I just installed using ionic plugin add and the plugin was added. I must have been adding using cordova add. Many thanks!