Failed to run protoc: No such file or directory (os error 2)
Quick deployment script throws error:
Environment:
OS: Ubuntu 22.04
curl https://cli.nexus.xyz/ | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2048 100 2048 0 0 15847 0 --:--:-- --:--:-- --:--:-- 15875 rustc 1.81.0 (eeb90cda1 2024-09-04) /root/.nexus/network-api exists. Updating. No local changes to save HEAD is now at f26774a fix: auto-updater bug fixes (#75) Compiling nexus-network v0.3.7 (/root/.nexus/network-api/clients/cli) The following warnings were emitted during compilation:
warning: [email protected]: Failed to run protoc: No such file or directory (os error 2)
error: failed to run custom build command for nexus-network v0.3.7 (/root/.nexus/network-api/clients/cli)
Caused by:
process didn't exit successfully: /root/.nexus/network-api/clients/cli/target/release/build/nexus-network-d12f3172b506ef1d/build-script-build (exit status: 1)
--- stdout
cargo:warning=Failed to run protoc: No such file or directory (os error 2)
--- stderr Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Whoever facing this, I have resolved this by creating a new user with sudo privileges. have tried it in 2 VMs with same spec.
Both triggered same error and after creating new sudo account , BOOM it worked.
brew install protobuf
run this cmd first
the same problem, the protobuf is needed
sudo snap install protobuf
maybe this command should be added into the quick deployment script
#On Debian run Sudo apt-get install -y protobuf-compiler #verify install Protoc —version
#On Debian run Sudo apt-get install -y protobuf-compiler #verify install Protoc —version
install protoc success, it's libprotoc 3.6.1. But when I install nexus.xyz, it said
error: failed to run custom build command for nexus-network v0.4.0 (/root/.nexus/network-api/clients/cli)
Caused by:
process didn't exit successfully: /root/.nexus/network-api/clients/cli/target/release/build/nexus-network-01d0541f667d1829/build-script-build (exit status: 1)
--- stderr
Error: Custom { kind: Other, error: "protoc failed: Unknown flag: --experimental_allow_proto3_optional\n" }
Command 'protoc' NOT found, you need to install it. Get a pkg from https://github.com/protocolbuffers/protobuf/releases for your os and install it. Then you will fix it
I found the way. Just navigate to #111