To update your package.json file, include the following resolutions:
"resolutions": {
"lodash": "<target or latest version>",
"axios": "<target or latest version>"
},
"dependencies": {
...
"lodash": "<latest>",
"axios": "<latest>",
...
}
This approach ensures that packages with their own versions of lodash or axios will use the most recent ones available instead.
You can confirm this by running console.log(lodash.version)
.
However, keep in mind that significant version differences, such as 3.0.0 versus 2.0.0, may lead to compatibility issues. It is recommended to conduct thorough testing in such cases.
For further insights, check out these resources:
https://example.com/npm-dependency-resolution-guide
https://example.com/yarn-selective-resolutions-docs