No matching version is found by solita for anchor-cli: 0.28.0 on https://crates.io/crates/anchor-cli/versions , which gives error.
2 Answers
fix I'm using:
in cargo.toml inside programs/name_of_your_program change anchor-lang to 0.27.0
do NOT run anchor build
then run yarn solita
, it will initialy start working but fail at the end
that will create anchor v27 binary inside /name_of_your_program/.crates/bin
avm use 0.28.0
where anchor
copy that binary to .crates/bin/anchor to replace the 27 that solita built there
then change back cargo.toml to 0.28.0
rerun yarn solita
Hopefully soon anchor crate.io will get published at that whole tedious process won't be needed
Solution posted by @zkKirol : https://discord.com/channels/848060988636921856/849844496941842432/1153277836157796383
Download the anchor-cli : 0.28.0 binary and copy paste it in .crates
folder which solita creates then run yarn solita
again.
You can download the binary either using avm
or from https://www.npmjs.com/package/@coral-xyz/anchor-cli?activeTab=code
-
This worked great for me. I already had it in my node_modules so just had to copy it over Commented Dec 23, 2023 at 1:53