Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7671

cordova fails to uninstall plugin when its dependencies is not installed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None

    Description

      Cordova-lib from latest master (https://github.com/apache/cordova-lib/commit/1df6bb67bfc8906d81cafd0f4d9c61fcacfc29c9) fails to remove a plugin which have an unsatisfied dependencies.

      Currently cordova doesn't install dependencies for top-level plugins, if no platforms are added to application. In this case uninstalling a newly installed plugin will cause following error:

      Error: ENOENT, no such file or directory 'd:\PROJECTS\Temp\test-file\plugins\org.apache.cordova.file\plugin.xml'
          at Object.fs.openSync (fs.js:427:18)
          at Object.fs.readFileSync (fs.js:284:15)
          at Object.module.exports.parseElementtreeSync (d:\cordova\cordova-lib\cordova-lib\src\util\xml-helpers.js:121:27)
          at findDependencies (d:\cordova\cordova-lib\cordova-lib\src\plugman\uninstall.js:122:34)
          at d:\cordova\cordova-lib\cordova-lib\src\plugman\uninstall.js:127:17
          at Array.forEach (native)
          at findDependencies (d:\cordova\cordova-lib\cordova-lib\src\plugman\uninstall.js:124:14)
          at Function.module.exports.uninstallPlugin (d:\cordova\cordova-lib\cordova-lib\src\plugman\uninstall.js:131:5)
          at d:\cordova\cordova-lib\cordova-lib\src\cordova\plugin.js:198:54
          at _fulfilled (d:\cordova\cordova-lib\cordova-lib\node_modules\q\q.js:798:54)
      

      The problem is in newly introduced function findDependencies in plugman/uninstall.js module (https://github.com/apache/cordova-lib/commit/1df6bb67bfc8906d81cafd0f4d9c61fcacfc29c9#diff-3c81061410a41f357169174bd1bfa5c0L123) which doesn't checks if plugin's config.xml file is exists.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladimir.kotikov Vladimir Kotikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: