You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Olivier Goguel (JIRA)" <ji...@apache.org> on 2018/01/17 08:40:01 UTC

[jira] [Created] (CB-13789) Local plugins cannot be installed after a fresh installation

Olivier Goguel created CB-13789:
-----------------------------------

             Summary: Local plugins cannot be installed after a fresh installation
                 Key: CB-13789
                 URL: https://issues.apache.org/jira/browse/CB-13789
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-cli
    Affects Versions: 7.0.2
         Environment: It is in Cordova 8.0.0 (but the interface did not allow me to select it!)
            Reporter: Olivier Goguel


Local plugins fails to install after a fresh installation (from source control for example)

*Steps:*

{{cordova create sample}}

{{cordova add plugin local/localplugin}}

{{rm -rf plugins # to simulate fresh installation}}

{{cordova platform add ios}}

{color:#FF0000}*Failed to restore plugin "localplugin" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin file:local/localplugin via registry.*{color}

*Hints:*

The plugin does not install as cordova is confused by the "file:" prefix

When adding the plugin, it is referenced in package.json as {{"localplugin": "file:local/localplugin", but in the config.xml the file: prefix has been stripped "<plugin name="localplugin" spec="local/localplugin" />"}}

However, when restoring the plugin, it uses the file: prefix which is not supported by the cli as the protocol is not properly handled: the fetch() function just tries to load the plugin from the path being given, cannot find it because of the prefix, and then assume it has to be loaded from the registry, hence the error

cf. https://github.com/apache/cordova-lib/blob/master/src/plugman/fetch.js#L86

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org