如何从 ionic 2/3 或 ionic V2+ 项目中删除已安装的 ionic cordova 插件 [英] How to remove installed ionic cordova plugin from ionic 2 / 3 or ionic V2+ project

查看:47
本文介绍了如何从 ionic 2/3 或 ionic V2+ 项目中删除已安装的 ionic cordova 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ionic3 项目中安装了 Cordova 和 Ionic Native 插件.

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

但我只需要从项目中完全删除特定的 Cordova 和 Ionic Native 插件.(像 npm 这样的依赖项).

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?

感谢您的任何帮助.

谢谢!

推荐答案

我只是参考他们的文档 这里.

I just refer their document here.

例子:

安装我们正在使用以下方式的插件.

To install a plugin we are using following way.

ionic cordova 插件添加 <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>ionic cordova plugin rm <plugin-name>

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

最后从 npm 卸载相关的 Ionic Native 包

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)

--save 标志将删除该插件的项目的 package.json 条目

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

执行上述操作有助于我从项目中完全删除插件及其 npm 依赖项.希望这对其他人有用

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

这篇关于如何从 ionic 2/3 或 ionic V2+ 项目中删除已安装的 ionic cordova 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆