Current Behavior:
If you have a package with something in peerDependencies and then install that something in the same package as a devDependency, the peerDependencies field is changed and the dependency is added to package.json, but it inherits the semver string that the peer dependency had.
Expected Behavior:
Installing a dev dependency should do the same change to the package.json, whether that dependency is already in peerDependencies or not.
Steps To Reproduce:
echo '{ "peerDependencies": { "typescript": "*" } }' > package.json
npm i -D typescript
cat package.json
{"peerDependencies":{"typescript":"^4.1.5"},"devDependencies":{"typescript":"*"}}
Environment:
- OS: macOS
- Node: 15.8.0
- npm: 7.5.4