Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove installed ionic cordova plugin from ionic 2 / 3 or ionic V2+ project

I installed Cordova and Ionic Native plugins into the ionic3 project.

But I need to remove only that specific Cordova and Ionic Native plugins from the project completely. (With its dependencies like npm).

Is there any proper way to do that?

Appreciate any kind of your help.

Thank you!

like image 207
coder Avatar asked Mar 05 '18 04:03

coder


People also ask

How do I remove a Cordova plugin?

It is not possible to remove plugins or platforms in this manner. The recommended method of adding and removing plugins and platforms is with the command line cordova commands cordova plugin add|remove ... and cordova platform add|remove ... to avoid any out of sync issues.

How do I remove an Ionic project plugin?

Sometimes user remove plugins by deleting the plugin folder from plugins folder, but the plugin is defined in config. xml as well as package. json . Removing the plugin using the CLI removes all trace of it.


1 Answers

I just refer their document here.

Example:

To install a plugin we are using following way.

ionic cordova plugin add <plugin-name>

(ionic cordova plugin add cordova-plugin-dialogs)

npm install --save @ionic-native/<npm-name-of-plugin>

(npm install --save @ionic-native/dialogs)

To Uninstall the plugin just need to revert above things back as bellow

ionic cordova plugin remove <plugin-name> or ionic cordova plugin rm <plugin-name>

(ionic cordova plugin remove cordova-plugin-dialogs) or (ionic cordova plugin rm cordova-plugin-dialogs)

Finally uninstall the associated Ionic Native package(s) from npm

npm uninstall --save @ionic-native/<npm-name-of-plugin>

(npm uninstall --save @ionic-native/dialogs)

The --save flag will remove the project's package.json entry for that plugin

Doing above things helps me to remove plugin completely with its npm dependencies from the project. Hope this will useful to someone else

like image 159
coder Avatar answered Sep 20 '22 14:09

coder