Skip to content

'yarn install --production' does not install transitive dependencies if listed as devDependencies in the project #2819

Description

@scinos

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

What is the current behavior?

In a project A with a dependency on B and B having a dependency on C, yarn install --production wont install C if C is listed as a devDependency of A. npm does.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a project with:
{
  "name": "test",
  "version": "1.0.0",
  "dependencies": {
    "sequelize-cli": "^2.5.1"
  },
  "devDependencies": {
    "gulp": "^3.9.1"
  }
}

(note that sequelize-cli has a dependency on gulp:

{
  "dependencies": {
    "gulp": "^3.9.1",
  }
}
  1. Run yarn install --production

  2. Try to find gulp: ls node_modules/gulp returns nothing.

However, if the package is

{
  "name": "test",
  "version": "1.0.0",
  "dependencies": {
    "sequelize-cli": "^2.5.1"
  }
}

yarn install --production will install gulp

What is the expected behavior?

Transitives production dependencies are always installed, even if the project declares them as devDependencies.

Please mention your node.js, yarn and operating system version.

  • node 7.3.0
  • yarn 0.21.3
  • OSX 10.12.3 (Sierra)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions