berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: YN0082: โ”‚ @microsoft/kiota-abstractions@npm:*: No candidates found

Open 1oglop1 opened this issue 1 year ago โ€ข 7 comments

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

1oglop1 avatar Aug 23 '24 08:08 1oglop1

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)

baywet avatar Sep 12 '24 12:09 baywet

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?

clemyan avatar Sep 13 '24 05:09 clemyan

Maybe we can do that, or use latest as 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).

arcanis avatar Sep 13 '24 09:09 arcanis

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?

clemyan avatar Sep 13 '24 11:09 clemyan

That's what I'm thinking, yes

arcanis avatar Sep 13 '24 11:09 arcanis

Is there any workaround for this? I'm also having an issue with @microsoft/kiota-bundle.

zZHorizonZz avatar Sep 24 '24 09:09 zZHorizonZz

@zZHorizonZz You can use resolutions to bypass the default resolution algorithm, e.g.:

"resolutions": {
  "@microsoft/kiota-abstractions": "npm:latest"
},

clemyan avatar Oct 02 '24 12:10 clemyan