1

I am using ionic 4 and I have 7 plugins installed in the project. And I want to update all plugin at once using a single command.

I try to use the ionic state reset but got this error.

E:\project\demo>ionic state reset
[ERROR] ionic state has been removed.

    We recommend using Cordova directly to manage Cordova plugins and platforms.
    The following commands fulfill the old ionic state functionality:

         ionic cordova platform save   | save existing installed platforms to config.xml
         ionic cordova plugin save     | save existing installed plugins to config.xml
         ionic cordova platform --help | view help page for managing Cordova platforms
         ionic cordova plugin --help   | view help page for managing Cordova plugins
         ionic cordova prepare         | install platforms and plugins listed in config.xml

    See https://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/ for detailed information.

Looks like this is not working in ionic 4, so is there any way to update plugins in Ionic 4?

user9088454
  • 1,076
  • 1
  • 15
  • 45

2 Answers2

2

Clear plugins folder, then call cordova prepare.

rm -rf plugins/
ionic cordova prepare

It worked for me!

Eldar
  • 9,781
  • 2
  • 10
  • 35
facu1974
  • 21
  • 3
0

Installl this command npm install -g cordova-check-plugins and run this cordova-check-plugins --update=auto at the root of your project directory.

The command will check for any outdated plugins and update them.

Also while updating, it might return error on some plugins if not able to update them, for such issue, just manually remove and add the plugin back.