`yarn add` in workspace adds to `dependencies` when it should update `devDependencies`

Do you want to request a feature or report a bug?

What is the current behavior?
Changing directory into a workspace and using yarn add nock adds nock to the dependencies for the package.json, rather than updating the version in devDependencies. Different versions of nock are then present within the same package.json in the dependencies and devDependencies.

I’ve created a repo so you can easily replicate, with a PR showing the erroneous result, here.

What is the expected behavior?
Yarn should update the devDependencies version of nock, like it would have done were we not in a workspace.

Please mention your node.js, yarn and operating system version.
Node: v8.9.1
Yarn: v1.3.2
OS: macOS 10.12.6

Author: Fantashit

2 thoughts on “`yarn add` in workspace adds to `dependencies` when it should update `devDependencies`

  1. Sorry for the delay! So I was able to verify this bug on my end. yarn workspace package1 [add/upgrade] nock only seems to work on upgrading dependencies, and not devDependencies.

Comments are closed.