Install/Update fails building @discordjs/opus (Raspberry Pi ARM64 and some Linux distros)
If `openclaw update` or `npm i -g openclaw@...` fails while building `@discordjs/opus`, install build tools and retry with the ARM64 CFLAGS workaround (or pin a known-good OpenClaw version).
Symptoms
openclaw updatefails during the npm step, ornpm i -g openclaw@...fails.- The failure shows
@discordjs/opus(native module) and often includes one of:node-pre-gyp ERR! install response status 404 ...(missing prebuilt binary).../celt_neon_intr.c: ... implicit declaration of function 'celt_inner_prod_neon'
Cause
@discordjs/opus tries to download a prebuilt binary for your exact Node ABI + platform.
When that prebuild isn’t available, it falls back to compiling from source (node-gyp), which can fail on some Linux/ARM64 setups without the right toolchain and/or a platform-specific define.
Fix
1) Ensure build tools are installed
On Debian/Ubuntu/Raspberry Pi OS:
sudo apt update
sudo apt install -y build-essential python3 make g++
2) ARM64 workaround (Raspberry Pi): install/update with CFLAGS
env CFLAGS='-DOPUS_ARM_MAY_HAVE_NEON_INTR' npm i -g openclaw@latest
If you’re pinned to a specific version (example):
env CFLAGS='-DOPUS_ARM_MAY_HAVE_NEON_INTR' npm i -g openclaw@2026.2.21-2
2.5) “One-and-done” workaround: persist CFLAGS for future updates
If you keep hitting this on every openclaw update, set the flag in your shell profile so it is present whenever you run updates:
echo "export CFLAGS='-DOPUS_ARM_MAY_HAVE_NEON_INTR'" >> ~/.profile
source ~/.profile
Notes:
- This helps when you update via
openclaw update(it runs your package manager and inherits the current environment). - If you update via a background service/Control UI (gateway-managed update), set the same env var in the gateway service environment instead (systemd/launchd/Docker env).
3) If you’re blocked and just need a working gateway right now: pin a known-good version
npm i -g openclaw@2026.2.19-2
openclaw gateway restart
Verify
openclaw version
openclaw status
If it still fails, paste:
node -v
uname -a
gcc --version
Plus the last ~40 lines of the @discordjs/opus build error.