Uploaded image for project: 'GPII - Global Public Inclusive Infrastructure'
  1. GPII - Global Public Inclusive Infrastructure
  2. GPII-492

Multiple copies of infusion get installed by npm, causing the Flow Manager to fail to start

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: C4A Portugal Workshop
    • Fix Version/s: C4A Year 3
    • Component/s: GPII Framework
    • Labels:
      None
    • Environment:
      npm >= 1.3.21

      Description

      Recent versions of npm appear to have changed the way they manage git-based dependencies. In the past, if we declared a dependency in package.json like this:

      "infusion": "git://github.com/fluid-project/infusion.git#e4d30d167cecee9069b28d9b6cc3591cc767ca53"

      npm would be smart enough to match other modules' need for the same version of Infusion and only install it once. With npm 1.3.21 and 1.3.22, I have noticed that this is no longer the case. npm is installing multiple copies of the same dependency.

      I haven't yet tracked down when or why this changed in npm.

      The result of this issue is that two copies of Infusion end up getting instantiated at run time. Kettle, as a result, gets its own separate instance of Infusion from universal. This means that Kettle never properly loads itself globally and as a result can't be used.

      The error I encounter when I try to run an instance of the Flow Manager with this bug in place is:

      "Cannot autoInit component gpii.matchMaker which does not have an initFunction and gradeNames defined"

      This is due to the fact that the kettle.app grades aren't available to be properly mixed into gpii.matchMaker.

      A temporary workaround for this is to delete Kettle's copy of Infusion:

      rm -rf gpii/node_modules/universal/node_modules/kettle/node_modules/infusion

      We need to:

      1. Determine if there is a "correct" way of using git-based dependencies with npm that we are unaware of
      2. If not, create a simplified example and file a bug with the npm folks
      3. If that doesn't work, consider writing our own "clean up" script that will walk the tree of node_modules dependencies and remove duplicate copies of shared resources such as Infusion.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sgithens Steven Githens
              Reporter:
              colin Colin Clark
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: