Open
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
Recently it has come to my attention that if a package's dist-tag has a specific format, I.e. the regex format of /v\d{2}-[a-z]{1,}/
that yarn throws an error:
❯ yarn add discord.js@v13-lts
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: discord.js@v13-lts isn't supported by any available resolver
at Bd.getResolverByDescriptor (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:391:1664)
at Bd.bindDescriptor (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:391:1053)
at ee (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:439:6954)
at async Promise.allSettled (index 0)
at async ho (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:390:10446)
at async /Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:439:8292
at async Je.startProgressPromise (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:390:48066)
at async ze.resolveEverything (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:439:6285)
at async /Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:442:2132
at async Je.startSectionPromise (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:409:3303)
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 17ms
Likewise the format of /v\d{2}/
also doesn't work:
❯ yarn add @favware/skip-dependency@v13
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: @favware/skip-dependency@npm:v13: No candidates found
at ce (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:439:7864)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.allSettled (index 0)
at async ho (/Users/favna/workspace/temp/.yarn/releases/yarn-3.2.3.cjs:390:10446)
➤ YN0000: └ Completed in 2s 593ms
➤ YN0000: Failed with errors in 2s 595ms
Both of these dist-tags install just fine with Yarn v1, NPM and PNPM.
To reproduce
const installPromise = packageJsonAndInstall({
dependencies: {
[`discord.js`]: `v13-lts`,
},
});
await expect(installPromise)
.resolves.toBeTruthy();
Environment
System:
OS: macOS 12.5.1
CPU: (8) arm64 Apple M1
Binaries:
Node: 18.8.0 - /private/var/folders/jy/w45_1th97698mzgm_nsfl35w0000gn/T/xfs-de02679f/node
Yarn: 3.2.3 - /private/var/folders/jy/w45_1th97698mzgm_nsfl35w0000gn/T/xfs-de02679f/yarn
npm: 8.18.0 - ~/.volta/tools/image/node/18.8.0/bin/npm
Additional context
Besides the Sherlock reproduction the barest minimal way to reproduce the issue is by running:
yarn set version 3.2.3 && yarn add discord.js@v13-lts