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

cordova-fetch is unable to install from url or file system using package.json

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-fetch
    • Labels:
      None

      Description

      This is a big issue in cordova@8 since you can't opt out of cordova-fetch. Using a url such as `github.com` or the file system for a plugin doesn't work with package.json. It still works using config.xml:

          <plugin name="cordova-plugin-repo" spec="https://github.com/user/cordova-plugin-repo#specific-branch" />
          <plugin name="local-plugin" spec="src/local-plugin" />
      

      This works when running cordova platform add. However, if you do not use --nosave this will update package.json dependencies:

          "cordova-plugin-repo": "git+https://github.com/user/cordova-plugin-repo#branch",
          "local-plugin": "file:src/local-plugin",
      

      If you try to install with package.json like this, you'll get errors for these packages:

      Failed to restore plugin "cordova-plugin-repo" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin https://github.com/user/cordova-plugin-repo#branch via registry.
      Probably this is either a connection problem, or plugin spec is incorrect.                                                                                                                     Check your connection and plugin name/version/URL.
      TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      Discovered plugin "local-plugin" in config.xml. Adding it to the project
      Failed to restore plugin "local-plugin" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin file:src/local-plugin via registry.
      Probably this is either a connection problem, or plugin spec is incorrect.
      Check your connection and plugin name/version/URL.                                                                                                                                             Failed to get absolute path to installed module
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ajcrites Andrew Crites
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: