Brian Jesse created CB-12474:
--------------------------------

             Summary: Dependencies in the root project directory can conflict 
with those in plugins
                 Key: CB-12474
                 URL: https://issues.apache.org/jira/browse/CB-12474
             Project: Apache Cordova
          Issue Type: Bug
          Components: CLI
    Affects Versions: 6.5.0
         Environment: OSX: 10.12.3
node: v7.4.0
npm: 4.2.0
Cordova-ios: 4.3.1
Cordova-android: 6.1.2
            Reporter: Brian Jesse


I've created a project with several npm dependencies and several Cordova 
plugins. One of my dependencies, Braintree, and one of my Cordova plugins, 
Branch.io, both depend on the same package, xml2js. Braintree's version is 
significantly out of date while Branch.io's version is much more recent. There 
were breaking changes introduced between these package versions.

When running the "cordova build ios android" command a hook script is called 
inside of the Branch.io plugin. This plugin hook script ends up loading the 
version of npm2js that is required by Braintree.

I am not completely familiar with how dependency management is handled inside 
of a plugin currently, but if I were to guess, it seems like plugin dependency 
installation does not respect the dependency structure at the project level, 
but the execution environment seems to be at the project level never-the-less.

My project structure is as follows:
project/
   - config.xml
   - www/
   - platforms/
   - plugins/
   - package.json
   - node_modules

Here is a link to a minimal environment to reproduce this issue:
https://gist.github.com/BrainBacon/2c3b629507576a5f4d849a3a2d64b66f
simply run "npm test" in a new directory with both of the included files and an 
error will occur.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to