anchor
anchor copied to clipboard
`% anchor test` error: no such command: `build-bpf`
I am using MAC M1 and I just installed solana and anchor. No idea how to solve this?
I also tried cargo install solana-cargo-build-bpf
but I got error error: could not find
solana-cargo-build-bpfin registry
crates-iowith version
*``
What is your solana version?
What is your solana version?
solana-cli 1.13.8 (src:43daa379; feat:1775889670)
What's the output of cargo build-bpf --version
? I'd also try with latest solana version(1.14.17).
cargo build-bpf --version
cargo build-bpf --version
error: no such command: `build-bpf`
View all installed commands with `cargo --list`
Also, I installed solana using sh -c "$(curl -sSfL https://release.solana.com/v1.15.2/install)"
How can I choose a later version.
Also, I installed solana using
sh -c "$(curl -sSfL https://release.solana.com/v1.15.2/install)"
How can I choose a later version.
You can change the version in the link to whichever version you want. There is also solana-install init <VERSION>
command if you already have solana installed.
This seems like a solana installation issue rather than Anchor issue.
Make sure active release of solana is in your $PATH
and try using anchor test --arch sbf
since build-bpf
is getting deprecated anyway.
Also, I installed solana using
sh -c "$(curl -sSfL https://release.solana.com/v1.15.2/install)"
How can I choose a later version.You can change the version in the link to whichever version you want. There is also
solana-install init <VERSION>
command if you already have solana installed.This seems like a solana installation issue rather than Anchor issue.
Make sure active release of solana is in your
$PATH
and try usinganchor test --arch sbf
sincebuild-bpf
is getting deprecated anyway.
@acheroncrypto We need dfinity ICP smart contract developer would you like to join our team?
Now
solana --version
solana-cli 1.15.2 (src:dea65f48; feat:1211687720, client:SolanaLabs)
but I am still facing the same issue.
Also, anchor test --arch sbf
yield
error: Found argument '--arch' which wasn't expected, or isn't valid in this context
If you tried to supply '--arch' as a value rather than a flag, use '-- --arch'
Usage: anchor test [OPTIONS] [ARGS]... [-- <CARGO_ARGS>...]
For more information try '--help'
Any update on this i still face same problem
Now
solana --version solana-cli 1.15.2 (src:dea65f48; feat:1211687720, client:SolanaLabs)
but I am still facing the same issue. Also,
anchor test --arch sbf
yielderror: Found argument '--arch' which wasn't expected, or isn't valid in this context If you tried to supply '--arch' as a value rather than a flag, use '-- --arch' Usage: anchor test [OPTIONS] [ARGS]... [-- <CARGO_ARGS>...] For more information try '--help'
It seems there was a misunderstanding. The
--arch sbf
flag you mentioned is not a valid flag for the anchor test command. for the test environment, you can try this command:anchor test -- --arch sbf
If you encounter any further issues or have additional questions, please let me know
Why add --arch, just run anchor test
is ok.
Hey guys, I am having the same issue. I have recently installed rustc and solana. I wanted to try out anchor but I am facing this issue building basically the empty project after initialization. solana-cli 1.16.24 (src:00000000; feat:4033350765, client:SolanaLabs) rustc 1.75.0 (82e1608df 2023-12-21) 0.29.0 (latest, installed, current)
I installed anchor using avm.
Basically when I execute build I get
error: no such command: build-bpf
View all installed commands with cargo --list
Find a package to install build-bpf
with `cargo search cargo-build-bpf
I think this is from package solana-cargo-build-bpf which has been yonked.
Can you please assist?
Thanks and best regards
came across this issue and realized the solana-cli was not being loaded in my env correctly. fixed the path and anchor build runs as expected
my solana version is solana-cli 1.17.25 (src:d0ed878d; feat:3580551090, client:SolanaLabs) I found solana installer set the follow line to $HOME/.profile
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
and this file will be run when you login, so you need to relogin or reboot to make the change effective.