-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededreproducibleThis issue can be successfully reproducedThis issue can be successfully reproduced
Milestone
Description
Describe the bug
Sometime I forgot to add --dev
when trying to add devDependencies. Doing so again will duplicate the dependency entry in package.json.
IMO, v1 will stop us and ask to remove the package first. For v2, we can just automatically move it.
To Reproduce
const {promises: {readFile}} = require(`fs`);
await packageJsonAndInstall({
devDependencies: {lodash: `*`},
});
await yarn(`add`, `lodash`);
const pkgJson = JSON.parse(await readFile(`package.json`, `utf8`));
expect(pkgJson.dependencies).not.toHaveProperty(`lodash`);
Environment if relevant (please complete the following information):
- OS: OSX
- Node version: 10.16.2
- Yarn version: 2.0.0-rc1 (tag 2019-08-16)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededreproducibleThis issue can be successfully reproducedThis issue can be successfully reproduced