0

Ran the code npm run build:program-rust getting this error I've tried uninstalling and reinstalling rustup and also solana tool chain still nothing

[email protected] build:program-rust cargo build-bpf --manifest-path=./src/program-rust/Cargo.toml --bpf-out-dir=dist/program

info: uninstalling toolchain 'solana' info: toolchain 'solana' uninstalled error: no such command: +solana

    Cargo does not handle `+toolchain` directives.
    Did you mean to invoke `cargo` through `rustup` instead?

2 Answers 2

2

This could come from a couple of sources:

  • Rust is old: be sure to upgrade with rustup update stable
  • the Solana toolsuite isn't installed: be sure to install it https://docs.solana.com/cli/install-solana-cli-tools
  • the Solana toolsuite is old: be sure to upgrade with solana-install init 1.17.13 (as of this writing)
0

This error has to do with a deprecated version where as before it would use cargo build - bpf but got deprecated wich probably means ur anchor cli its also deprecated.

Btw why are you calling this :npm run build:program-rust ??

if you are building in native rust its cargo build if you are using anchor should be anchor build

1
  • Some people do use native to build Solana instead of Anchor. It seems their main CLI was outdated as per Jon's answer
    – Jacob Creech
    Commented Jan 4 at 4:58

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.