I have updated Anchor to ^0.29.0, Solana to 1.16.18 (did try 1.17.4), and Rust Compiler to 1.73.0. The anchor build runs successfully, however, the anchor test always throws this exception. I have tried every possible set of versions in the last 2 days without any positive results.

thread 'main' panicked at 'called Option::unwrap() on a None value', cli/src/lib.rs:3128:55 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Does anyone know how to fix it? thanks in advance.

  • Also I recognize a weird behaviour. After reset the laptop, if I run the yarn first, I will got the error mentioned above. However, if I run the anchor test first, it will pass the test but I will get the error of zsh: segmentation fault yarn when run any yarn commands.
    – Tu Phan
    Commented Nov 3, 2023 at 6:21
  • I'm using yarn 1.22
    – Tu Phan
    Commented Nov 3, 2023 at 6:39
  • I also tried with yarn 4.0 but the error still persists.
    – Tu Phan
    Commented Nov 7, 2023 at 3:04
  • You should probably submit an issue to Anchor directly at github.com/coral-xyz/anchor/issues, this seems like a bug
    – Jon C
    Commented Nov 7, 2023 at 11:55

1 Answer 1


It seems like a conflict between yarn and anchor. Remove all the yarn-related files and use pnpm instead, it will work perfectly.

I may keep this problem open because this solution is a workaround and not solve the root.

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.