illixion / blog.illixion.com

0 stars 0 forks source link

2021/10/fix-failed-to-select-a-version-cargo/ #3

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to fix "failed to select a version for the requirement" in Rust's Cargo - Manual

Local registry cache corruption can cause issues where Cargo won’t be able to find new versions of packages. Here’s the solution.

https://catto.io/2021/10/fix-failed-to-select-a-version-cargo/

kurmanka commented 2 years ago

Thank you, Manual. I was hit by exactly this issue and was utterly confused. Deleting ~/.cargo/registry has helped.

illixion commented 2 years ago

@kurmanka no problem, glad to hear that my article helped you!

kkiplinger commented 2 years ago

Thank you! I was going crazing trying to resolve this problem!

HamzaYasin1 commented 1 year ago

Hi, I did the same thing you are referring to but nothing is fruitful, i'm working with substrate blockchain framework and getting this error.

   Command: cargo +nightly-2020-10-05 build

   Blocking waiting for file lock on package cache
   Updating crates.io index
   error: failed to select a version for the requirement `platforms = "^0.2.1"`
   candidate versions found which didn't match: 3.0.1, 3.0.0, 2.0.0, ...
    location searched: crates.io index
     required by package `substrate-build-script-utils v2.0.0`
      ... which is depended on by `nucoin v2.0.0 
illixion commented 1 year ago

Hi, I did the same thing you are referring to but nothing is fruitful, i'm working with substrate blockchain framework and getting this error.

   Command: cargo +nightly-2020-10-05 build

   Blocking waiting for file lock on package cache
   Updating crates.io index
   error: failed to select a version for the requirement `platforms = "^0.2.1"`
   candidate versions found which didn't match: 3.0.1, 3.0.0, 2.0.0, ...
    location searched: crates.io index
     required by package `substrate-build-script-utils v2.0.0`
      ... which is depended on by `nucoin v2.0.0 

I think this is a different issue, if you check the platforms crate page, you'll find that all of the 0.x.x versions have been yanked. substrate-build-script-utils is also old, most recent version is 3.0.0. Ask the maintainer of this "nucoin" package to update their dependencies.