Error: IDL doesnt exist. | Rust | Solana | Anchor

261 views Asked by At

I tried to build my project anchor build but I got

$ Error: IDL doesn't exist

target/idl/ and target/types/ were generated but they were empty. Then I tried anchor clean , anchor build. The same.

Then I tried anchor idl init -f <filepath> <program id>

$ Error: Is a directory (os error 21)

Then I finally tried anchor build -v

Using image "backpackapp/build:v0.29.0"
Run docker image
Error during Docker build: Docker build failed: No such file or directory (os error 2)
Error: Docker build failed: No such file or directory (os error 2)

I also tried:

  • change idl = true in Anchor.toml
  • delete no-idl = [] string in Cargo.toml

I'm on Ubuntu

1

There are 1 answers

0
oleksii On

I fixed it by reinstalling anchor-cli:

cargo uninstall anchor-cli
cargo install anchor-cli --version 0.27.0