Skip to content

Instantly share code, notes, and snippets.

@pdubroy
Created October 16, 2013 07:31
Show Gist options
  • Save pdubroy/7003974 to your computer and use it in GitHub Desktop.
Save pdubroy/7003974 to your computer and use it in GitHub Desktop.
A demonstration of "dependency hell" -- in particular, the problem of conflicting dependencies.
var x = require('x-1.3');
var foo = require('foo');
// Doesn't work because x is expecting v1.2 of the Thing interface.
foo.wiggle(x.makeThing());
var x = require('x-1.2');
function wiggle(thingFromX) {
thingFromX.doSomething();
}
@janv
Copy link

janv commented Oct 16, 2013

But npm for example already handles that situtation by giving each module its own dependency tree.

@pdubroy
Copy link
Author

pdubroy commented Oct 16, 2013

How does that handle the problem shown above? The problem is if doSomething has a different interface between version 1.2 and 1.3. In other words, the same name (doSomething) has different meanings in each module.

@janv
Copy link

janv commented Oct 16, 2013

Aah, now I get it!
Tricky thing, agreed

@janv
Copy link

janv commented Oct 16, 2013

I'm pretty sure this is an unsolveable problem.
Detectable, yes, but not (generally) solvable. It basically boils down to type incompatibilities (Something that Javascript hides on first sight, but it's that), where the type of something changes between versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment