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

Yarn resolutions only works with fixed versions not dist-tags #6666

Open
spoldman opened this issue Nov 12, 2018 · 3 comments
Open

Yarn resolutions only works with fixed versions not dist-tags #6666

spoldman opened this issue Nov 12, 2018 · 3 comments

Comments

@spoldman
Copy link

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

Yarn resolutions only works with fixed versions, not dist-tags

What is the current behavior?
Yarn installs react@latest not react@next

If the current behavior is a bug, please provide the steps to reproduce.
run the yarn install on the following package.json document

{ "name": "yarn-test", "version": "1.0.0", "license": "ISC", "private": true, "resolutions": { "react": "next" }, "dependencies": { "react": "latest" } }

What is the expected behavior?
Yarn installs react@next not react@latest

Please mention your node.js, yarn and operating system version.
yarn: 1.12.3
node: 8.11.4
os: Windows 10

@ghost ghost assigned imsnif Nov 12, 2018
@ghost ghost added the triaged label Nov 12, 2018
@rally25rs
Copy link
Contributor

When debugging this with the current code from master I noticed the warning:

warning Resolution field "next" has an invalid version entry and may be ignored
[1/4] 🔍  Resolving packages...

This comes from: https://github.com/yarnpkg/yarn/blob/master/src/resolution-map.js#L69-L72

    if (!semver.validRange(range) && !getExoticResolver(range)) {
      this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range));
      return null;
    }

So it looks like it wants to make sure that the resolution points to a valid semver range. This happens before the metadata for the package is loaded, so it wouldn't be easy to just check the actual tags and versions.

I'm going to tag this as a [feature-request] to support dist-tags in addition to versions. If anyone wants to work on this, help would be appreciated!

@kirill-konshin
Copy link

This is still reproduced 1 year after issue was created.

@subtleGradient
Copy link

Still a problem here in the distant future >:(

yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 1, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 7, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 9, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 14, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 14, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 19, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 25, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Jan 25, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Feb 6, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Feb 6, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Feb 21, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Feb 25, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Mar 10, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Apr 12, 2021
yaacovCR added a commit to ardatan/graphql-tools that referenced this issue Apr 15, 2021
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

5 participants