Kate Miháliková created CB-13741:
------------------------------------
Summary: Platform restoration not installing all plugins
Key: CB-13741
URL: https://issues.apache.org/jira/browse/CB-13741
Project: Apache Cordova
Issue Type: Bug
Components: cordova-cli
Affects Versions: [email protected]
Environment: node v6.9.4 and v7
npm v5.5.1 and 5.6.0
cordova CLI v7.1.0 and 8.0.0
Reporter: Kate Miháliková
Cordova CLI of version 7 and 8 is not installing some dependencies when
restoring the android platform using {{cordova prepare android}} when a
dependency of a plugin is explicitly listed in {{dependencies}} of
{{package.json}}.
[Test
case|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df]:
*
[{{config.xml}}|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-config-xml]
* [{{package.json}} that exhibits the
bug|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-package-json-wrong]
* [result of running {{cordova prepare android}} with the problematic
{{package.json}}|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-cordova-prepare-android-log-wrong]
* [result of running {{cordova prepare android --verbose}} with the problematic
{{package.json}}|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-cordova-prepare-android-verbose-log-wrong]
** {{cordova-plugin-network-information}} is not installed
* [{{package.json}} that works
fine|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-package-json-right]
* [result of running {{cordova prepare android}} with the working
{{package.json}}|https://gist.github.com/katemihalikova/5441af4a9417b5fde2572c82599f82df#file-cordova-prepare-android-log-right]
** {{cordova-plugin-network-information}} gets installed fine
Please note the difference of line 27 of those logs - the one with the bug
refers to the wrong plugin, thus skipping installing of the right one. It
consistently works this way for me:
* let's create plugin X (that depends on plugin A) and Y
* have plugin X and plugin Y in {{config.xml}} and in {{cordova.plugins}} of
{{package.json}}
* have all plugins X, A, and Y in {{dependencies}} of {{package.json}}
* remove platforms/ and plugins/ folders from previous install
* doesn't matter if {{npm install}} is run or if node_modules/ folder is deleted
* run {{cordova prepare android}}
* plugin Y (the one that is installed after plugin X, the plugin with a
dependency) is not installed at all
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]