2

I have a problem with path-to-regexp, I want to ensure if possible all dependencies go through 3.0.0.

I have ran

npm i path-to-regexp it adds this to my package.json:

"path-to-regexp": "^3.0.0",

But when I run

npm ls path-to-regexp

I get:

├── path-to-regexp@3.0.0
├─┬ react-router-dom@5.0.0
│ └─┬ react-router@5.0.0
│   └── path-to-regexp@1.7.0
└─┬ react-scripts@3.0.1
  └─┬ webpack-dev-server@3.2.1
    └─┬ express@4.17.0
      └── path-to-regexp@0.1.7

I want react-router-dom use 3.0.0.

Is this possible?

dagda1
  • 26,856
  • 59
  • 237
  • 450
  • Possible duplicate of [How do I override nested NPM dependency versions?](https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions) – Roland Weber Jun 01 '19 at 17:05

1 Answers1

0

Different modules are released by different teams, on different schedules, with independent version numbers. It makes no sense to force "all dependencies" to the same version.

How to override a specific dependency version, in your case react-router-dom, is explained here: https://stackoverflow.com/a/17423915/11451509

Roland Weber
  • 3,395
  • 12
  • 26