Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
Mac OS 10.13.2, cordova-cli 8.0.0.
Description
If you don't include a package.json in your project, my understanding (from here) was that running "cordova prepare" should create it, based on your config.xml.
This normally works fine. But if I include a plugin with a local path in config.xml, e.g.
<plugin name="cordova-plugin-test" spec="custom_plugins/cordova-plugin-test" />
and then run "cordova prepare" using cordova-cli 8.0.0, it will no longer download all the plugins' dependencies to node_modules. It only puts the platform and plugins that I specified in config.xml there, not any of their dependencies. And the package.json that it generates doesn't include the local plugin. As a result, it can cause errors with other plugins later on.
This wasn't the case with cordova-cli 7.x. Is it now a requirement that we include a package.json as well as a config.xml? This seems to mean that we need to maintain a duplicate list of plugin versions.
For an example, run "cordova prepare" on the attached project, using cordova-cli 8.0.0. The config.xml requests the "cordova-custom-config" plugin, which has several dependencies. They won't be loaded unless there's already a package.json that also requests that plugin.