2

This diagram explains my question ----> Version Conflict

My product takes a dependency on a node package, which takes a dependency on a certain version of Angular, lets say version #y.

However, my product relies on a different version of Angular - lets say version #x.

I cannot ensure that #x = #y.

What is the best way to avoid such version conflicts?

Sahil Malik
  • 101
  • 4

1 Answers1

0

If your dependency is for e.g. Angular X.Y and your angular version is X, compatibility problems shouldn't arise, but you can use npm shrinkwrap functionality which will allow you to lockdown version of dependencies.

It will generate npm-shrinkwrap.json file.

{
  "name": "A",
  "version": "1.1.0",
  "dependencies": {
    "B": {
      "version": "1.0.1",
      "from": "B@^1.0.0",
      "resolved": "https://registry.npmjs.org/B/-/B-1.0.1.tgz",
      "dependencies": {
        "C": {
          "version": "1.0.1",
          "from": "org/C#v1.0.1",
          "resolved": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4"
        }
      }
    }
  }
}

You can read more about it here.

Michał Pietraszko
  • 5,666
  • 3
  • 21
  • 27