1

I have the same problem of this post but cargo clean and cargo check doesn’t fix it.

This is my terminal output:

Updating crates.io index
error: failed to select a version for the requirement wasmtime = "^0.38.0"`
candidate versions found which didn't match: 0.37.0, 0.36.0, 0.35.3, ...
location searched: crates.io index
required by package sp-wasm-interface v6.0.0 (/substrate/primitives/wasm-interface)

Update

rustup show output:

Default host: x86_64-apple-darwin
rustup home:  /Users/*****/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.59.0 (9d1b2106e 2022-02-23)
7
  • You must have given different version of the dependencies, just the versions and delete cargo.lock file and then build it. Commented Jul 6, 2022 at 9:39
  • I tried to delete cargo.lock but didn't work. I don't know I see wasmtime version 0.38.0 on creates.io
    – viac92
    Commented Jul 6, 2022 at 10:50
  • And cargo find it if I search with cargo search wasmtime first result wasmtime = "0.38.1 # High-level API to expose the Wasmtime runtime
    – viac92
    Commented Jul 6, 2022 at 10:59
  • You need to match all the dependencies version, it should be same. Your cargo is finding wasmtime = 0.38.1 but it needs a lower version of wasmtime. Commented Jul 6, 2022 at 11:27
  • Yes I know, in the Cargo.toml I have wasmtime = 0.38.0 but form the output of my terminal it seems cargo can't select this version. Is it correct? sorry I'm new with Rust
    – viac92
    Commented Jul 7, 2022 at 8:52

1 Answer 1

0

Update rust toolchain with command rustup update fixed the issue.

You could also try clean the registry index by remove folder ~/.cargo/registry/index if you don't want to update the toolchain.

1
  • It works, thank you!
    – viac92
    Commented Jul 11, 2022 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.