Is it possible to add the specified semver range of the installed package from CLI rather than editing package.json manually?
The following command:
npm i --save-peer react@">= 18" svelte@"*"
results in changes in package.json:
"peerDependencies": {
"react": "^18.3.1",
"svelte": "^4.2.18"
}
But the required result is to add the exact semver ranges, including a wildcard:
"peerDependencies": {
"react": ">= 18",
"svelte": "*"
}
The resolved versions (18.3.1 and 4.2.18) should only be mentioned in package-lock.json, not package.json.
--save-prefixfor~or^and--save-exactfor neither, but not for others I don't think.