[Bug?]: YN0082: โ @microsoft/kiota-abstractions@npm:*: No candidates found
Self-service
- [ ] I'd be willing to implement a fix
Describe the bug
I am unable to install "@microsoft/msgraph-sdk": "1.0.0-preview.27" with yarn, I have no problem installing the package with npm or pnpm.
Package clearly exists here https://www.npmjs.com/package/@microsoft/kiota-abstractions
To reproduce
yarn add @microsoft/[email protected]
Environment
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 20.8.0 - /private/var/folders/79/bvt24ns10_n58z24g_klmhmm0000gn/T/xfs-e8c196ba/node
Yarn: 4.4.0 - /private/var/folders/79/bvt24ns10_n58z24g_klmhmm0000gn/T/xfs-e8c196ba/yarn
npm: 10.1.0 - ~/.asdf/plugins/nodejs/shims/npm
Additional context
I tried yarn versions 3.6.4, 3.8.4, 4.4.0.
Deleted the metadata yarn cache clean --all && rm -rf $(yarn config get globalFolder)/metadata as per #5989
Hi from the kiota team here ๐
yarn add @microsoft/kiota-bundle
โค YN0000: ยท Yarn 4.4.1
โค YN0000: โ Resolution step
โค YN0082: โ @microsoft/kiota-abstractions@npm:*: No candidates found
โค YN0000: โ Completed in 0s 253ms
โค YN0000: ยท Failed with errors in 0s 269ms
I've also tried clearing the cache and whatnot.
Is it possible the yarn registry is not indexing new packages properly/lagging? (I have not used yarn in a while, not sure whether there's some kind of proxy/registry that facades npm like go does)
All versions of @microsoft/kiota-abstractions on the npm registry are prerelease versions, which normally doesn't satisfy *.
Looks like pnpm just treat * as a synonym of latest
https://github.com/pnpm/pnpm/blob/eeb76cd1d0a3133d71d96de5646e305f34474652/resolving/npm-resolver/src/pickPackageFromMeta.ts#L148-L152
Maybe we can do that, or use latest as a fallback?
@arcanis What do you think?
Maybe we can do that, or use
latestas a fallback?
I think it'd make sense to tolerate the prerelease versions until at least one stable is released. We can't make * tolerate all prerelease everytime though, it wouldn't match semver (and would break backward compatibility).
I think it'd make sense to tolerate the prerelease versions until at least one stable is released. We can't make
*tolerate all prerelease everytime though, it wouldn't match semver (and would break backward compatibility).
To be clear, you are saying if the range is * and no version satisfies it, we should simply retry with includePrerelease instead of using latest?
That's what I'm thinking, yes
Is there any workaround for this? I'm also having an issue with @microsoft/kiota-bundle.
@zZHorizonZz You can use resolutions to bypass the default resolution algorithm, e.g.:
"resolutions": {
"@microsoft/kiota-abstractions": "npm:latest"
},