yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.44k stars 1.11k forks source link

[Bug?]: git+https dep from private package "isn't supported by any available resolver" #5243

Open blumfontein opened 1 year ago

blumfontein commented 1 year ago

Self-service

Describe the bug

Hi! Yarn 3 can't resolve git+https dependencies from custom gitlab instance of a private package. This worked in Yarn 1.

Th error:

Error: @my/dep@https://pull-token:some-token@my-gitlab.com/my/repo#semver:>=1 isn't supported by any available resolver
    at yf.getResolverByDescriptor (/projects/perfumer/platform/yarn-3.4.1.cjs:391:1647)
    at yf.bindDescriptor (/projects/perfumer/platform/yarn-3.4.1.cjs:391:1036)
    at Z (/projects/perfumer/platform/yarn-3.4.1.cjs:439:6900)

My package.json looks like this:

"dependencies": {
    "@my/dep": "git+https://pull-token:some-token@my-gitlab.com/my/repo#semver:>=1",
  },

To reproduce

I can send a link to repo in the private message

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
  Binaries:
    Node: 16.16.0 - /tmp/xfs-6e8ff5b1/node
    Yarn: 3.4.1 - /tmp/xfs-6e8ff5b1/yarn
    npm: 8.11.0 - /usr/bin/npm

Additional context

No response

r4m-ilyasm commented 1 year ago

I figured out, that this works with packages with simple names like "my-dep", but doesn't work with names with "@" like "@my/dep"

chenhebing commented 11 months ago

The patch protocol has the same problem with yarn@4.0.0.

4rcadiaN commented 6 months ago

Is there any update on this? This is blocking our team for quite some time from using yarn. Still not working in 4.2.1

wuhkuh commented 5 months ago

I ran into the same issue for patches. I managed to work around this as follows:

patch:@<SCOPE>/<PACKAGE>@npm%3A<VERSION>#~/.yarn/patches/@<SCOPE>-<PACKAGE>-npm-<VERSION>-<DIGEST>.patch

Effectively eliding the __archiveUrl segment. There might be a better manual workaround, but wanted to get this out there for now.