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

Inconsistent versions are assigned in nested packages. #4705

Closed
karak opened this issue Oct 13, 2017 · 7 comments
Closed

Inconsistent versions are assigned in nested packages. #4705

karak opened this issue Oct 13, 2017 · 7 comments

Comments

@karak
Copy link

karak commented Oct 13, 2017

yarn install assigns different version of one package between the package itself and nested packages. In my case, this behavior caused compile errors in TypeScript, and it may introduce many other troubles.

Minimum reproducing project is HERE.

Should yarn install assign consistent versions and keep the consistency after yarn upgrade in the future?

My environment is macOS Sierra & node 8.6.0, but same in 6.10.

@BYK
Copy link
Member

BYK commented Oct 16, 2017

Please provide the Yarn version you are having issues with.

@karak
Copy link
Author

karak commented Oct 16, 2017

@BYK yarn 1.2.1 reproduced this.

@edmorley
Copy link
Contributor

Hi! The STR are a bit unclear at the moment, since they don't include a before-upgrade state. Could you expand them slightly?

Running yarn install from that repo, yarn list then shows:

...
├─ @types/[email protected]
│  ├─ @types/node@*
│  ├─ @types/react@*
│  └─ @types/[email protected]
├─ @types/[email protected]

...whereas if I rm -rf yarn.lock node_modules && yarn install, I then get:

...
├─ @types/[email protected]
│  ├─ @types/node@*
│  └─ @types/react@*
├─ @types/[email protected]

I'm presuming after the yarn upgrade you were expected the latter (the versions to be consolidated)?

@edmorley
Copy link
Contributor

edmorley commented Oct 26, 2017

Though I guess this is a dupe of #3951 / #4136 - ie: @types/react-dom should fix its version ranges or start using peerDependencies?

@BYK
Copy link
Member

BYK commented Oct 26, 2017

@edmorley sounds like it. Shall we close this issue?

@karak
Copy link
Author

karak commented Oct 27, 2017

@edmorley

Hi! The STR are a bit unclear at the moment, since they don't include a before-upgrade state. Could you expand them slightly?

Oh, I can't remember that clearly, but it include some iterative yarn upgrade, and may include removing node_modules and reinstalling to try to fix. In addition to that, I found the order of arguments of yarn install affects to their versions.

Though I guess this is a dupe of #3951 / #4136 - ie: @types/react-dom should fix its version ranges or start using peerDependencies?

I agree you about the compile errors.

However, I still suspect why their versions differ by upgrading. Now, both of yarn upgrade @types/react and yarn upgrade @types/react @types/react-dom never update the "@types/react@*" entry in yarn.lock as bellow:

Before:

"@types/react@*":
  version "16.0.10"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.10.tgz#a24b630f5f1f170866a148a147d4fc8636ea88e0"

"@types/react@^16.0.7":
  version "16.0.7"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.7.tgz#f85b6c33c988a1631e2f32fedae71ec6d9718a0d"

After:

"@types/react@*":
  version "16.0.10"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.10.tgz#a24b630f5f1f170866a148a147d4fc8636ea88e0"

"@types/react@^16.0.7":
  version "16.0.18"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.18.tgz#c08eea79ada55bf10b5353e18c21797dd17afa23"

@karak
Copy link
Author

karak commented Nov 15, 2017

@BYK OK to close. Yarn doesn't matter this anyway.

@karak karak closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants