【问题标题】:How to remove all Plugins from Cordova all?如何从 Cordova 中删除所有插件?
【发布时间】:2016-07-05 06:45:16
【问题描述】:

谁能告诉我如何通过一个命令 OS windows 10 删除 Cordova 应用程序的所有插件。

【问题讨论】:

  • 在哪种情况下需要这样做?您可以使用cordova plugins 列出所有插件,然后使用cordova plugin rm cordova-plugin-1 cordova-plugin-2 ... 将它们全部删除。或者使用cd .. && cordova create anotherApp --template=firstApp 根据您的资产创建另一个应用程序(如果您没有插件saved 到config.xml,后者将起作用)。
  • 我的应用中有 12 个插件。我在 2 天前更新了 Android SDK,就在构建应用程序中提出的那个问题之后。也许其中之一正在制造问题。所以我想重新安装它们。
  • 那你可能应该一个一个地删除它们并检查它是否修复了构建。

标签: cordova phonegap-plugins cordova-plugins phonegap-cli


【解决方案1】:

我会尝试像这样使用 Cordova 钩子脚本:

#!/usr/bin/env node

//this hook removes all your plugins

// add your plugins to this list--either 
// the identifier, the filesystem location 
// or the URL
var pluginlist = [
    "org.apache.cordova.device",
    "org.apache.cordova.device-motion",
    "org.apache.cordova.device-orientation",
    "org.apache.cordova.geolocation",
    "https://github.com/chrisekelley/AppPreferences/"
];

var fs = require('fs');
var path = require('path');
var sys = require('sys')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) {
    sys.puts(stdout)
}

pluginlist.forEach(function(plug) {
    exec("cordova plugin rm " + plug, puts);
});

取自@devgirlFL blog

【讨论】:

  • 谢谢,我试试
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-06
  • 2018-12-05
  • 2017-03-12
  • 2016-12-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多