4

Not sure this is possible, but I need to override the version of a dependency's dependency. Specifically, I have this in my package.json:

"dependencies": {
  "connect": "*"
}

connect then has a dependency on "formidable": "1.0.11". I need connect to use version 1.0.13 of formidable.

Is it possible to override connect's dependency without cloning that project?

Steve Prentice
  • 23,230
  • 11
  • 54
  • 55
  • Did you ever find an answer to this? I have a similar problem. – Jonathan May 21 '14 at 16:01
  • npm shrinkwrap works for this: http://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions – huesforalice Jun 09 '15 at 14:49
  • Does this answer your question? [How do I override nested NPM dependency versions?](https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions) – josemigallas Jul 23 '20 at 09:46

1 Answers1

1

You can set "formidable": "1.0.13" at your package.json and if other package (in this case connect) which depends on formidable has appropriate condition to formidable version they will share single formidable package. In case of latest connect it doesn't work because it has "formidable": "1.0.11" at package.json and if you set "1.0.13" at your package.json you will get two formidable installed ("1.0.13" as your direct dependency and "1.0.11" as connect dependency). AFAIK, it's impossible to override dependency in this case.

Oleg Korobenko
  • 43
  • 1
  • 1
  • 6