Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected install behaviour in workspace based project #3980

Closed
donaldpipowitch opened this issue Jul 21, 2017 · 2 comments
Closed

Unexpected install behaviour in workspace based project #3980

donaldpipowitch opened this issue Jul 21, 2017 · 2 comments
Labels

Comments

@donaldpipowitch
Copy link
Contributor

donaldpipowitch commented Jul 21, 2017

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

bug?

What is the current behavior?

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

  1. $ git clone [email protected]:pedronauck/yarn-workspaces-example.git
  2. add "react": "15.0.1" to dependencies inside ./packages/a
  3. add "react": "^15.0.1" to dependencies inside ./packages/b
  4. run $ yarn in the root of the project

What is the expected behavior?

  • only [email protected] is installed at ./node_modules/react (because b accepts 15.0.1, too) (I'd expect this to be the default behaviour)

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

  • Node v6.9.1
  • yarn v0.27.5
  • Mac OS X

Workspaces look great so far! ♥


Question

I'm not certain if resolutions is already implemented. I saw this in several issues, but not in any docs. Given it is implemented, should this issue be workaround by adding this part to ./package.json?:

"resolutions": {
  "react": "15.0.1"
}

I don't want to install everything flat (not if some lib wants ^1.0.0 and another lib wants ^2.0.0 from a certain dep), but I do want to install it as flat as possible, if versions fit into a range (like in this case, because 15.0.1 fits into ^15.0.1).

@bestander
Copy link
Member

I think this is not directly workspace related, it is inefficiency of our resolution algorithm.
We need to make it smarter, see this issues for details #3778

help is welcome

@donaldpipowitch
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants