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

Cordova 7 breaks npm install if any declared plugin doesn't contain package.json

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • cordova@7.0.0
    • None
    • None
    • OSX 10.12.15, npm 3.10.10, Cordova 7.0.1

    Description

      As of Cordova 7, plugins declared in config.xml are automatically added to dependencies in package.json on prepare. This limits Cordova 7 projects to plugins that are also node packages, as the npm install process will break if any declared dependency does not contain a valid package.json (see related npm error).

      Quite a few functioning Cordova plugins (e.g. CordovaClipboard, PrivacyScreen) live on GitHub and don't contain a package.json. In order to use such plugins in conjunction with Cordova 7 without breaking npm install, we must omit the plugin declarations from config.xml and commit the contents of the /plugins directory.

      To be clear, this is not a malfunction of the Cordova CLI. Rather, this is a side-effect of the automated mirroring of config.xml and package.json configuration in Cordova 7.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Spence Spence DiNicolantonio
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: