How do we resolve "failed to run custom build command for `hidapi v1.4.1`" when attempting "cargo install spl-token-cli" on Ubuntu?

1 Answer 1


Across the different answers that I found, this worked for me and a lot of people who encountered this:

rustup component add rustfmt

sudo apt-get update

sudo apt install build-essential

sudo apt-get install libssl-dev libudev-dev libusb-1.0-0-dev pkg-config zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler

Then try it again:

cargo install spl-token-cli

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.