I have a main application with a package.json
:
{
name: "My App",
"dependencies": {
"@myGroup/someLib: "0.2.0"
"@myGroup/common: "0.10.0" --> The version is fixed.
}
}
Here is the package.json
of my lib:
{
name: "@myGroup/someLib",
"dependencies": {
"@myGroup/common: "^0.3.0" --> Notice the caret
}
}
When doing a npm install
, NPM will install 2 different versions, 0.3.0 and 0.10.0.
I'm expecting to have a single version installed given the caret. How can I achieve that? Is it the expected outcome?
Should I rather use peerDependencies
?