Bug
scripts/postinstall-bundled-plugins.mjs lines 787-791 attempt to prune /tmp/node-compile-cache/v<NODE>-x64-<HASH>-0. When the directory is owned by a different user (e.g., created by a previous root-owned install or by a shared cache from another user on the same host), the prune fails:
[postinstall] could not prune OpenClaw compile cache: Error: EACCES, Permission denied: /tmp/node-compile-cache/v24.13.0-x64-cf738c9d-0
The script handles this with a try/catch that emits a warning, but the warning misleads users into thinking something is broken.
Impact
Cosmetic. Postinstall completes successfully; the WARN just adds noise during the upgrade workflow. Particularly visible when the v5.2 upgrade procedure prescribes running node scripts/postinstall-bundled-plugins.mjs manually with OPENCLAW_EAGER_BUNDLED_PLUGIN_DEPS=1 after --ignore-scripts install.
Proposed fix
In the catch block, check err.code === "EACCES" and silently skip:
} catch (err) {
if (err.code === "EACCES" || err.code === "EPERM") {
// shared compile cache not writable by current user; safe to skip
return;
}
console.warn(`[postinstall] could not prune OpenClaw compile cache: ${err}`);
}
Alternative: prefix the cache path with the current uid (e.g. /tmp/node-compile-cache-${process.getuid()}/...) so each user has its own cache, sidestepping the shared-cache permission issue entirely.
Repro
- As root (or sudo):
npm install -g [email protected] --ignore-scripts
- Run postinstall:
cd /usr/lib/node_modules/openclaw && node scripts/postinstall-bundled-plugins.mjs
- As non-root user:
npm install -g [email protected] --ignore-scripts
- Run postinstall as that user; observe the EACCES WARN
Environment
- OpenClaw v2026.5.2 (8b2a6e5)
- Debian 11 (Bitnami AWS instance)
- Node 24.13.0
- Compile cache path:
/tmp/node-compile-cache/v24.13.0-x64-cf738c9d-0
Bug
scripts/postinstall-bundled-plugins.mjslines 787-791 attempt to prune/tmp/node-compile-cache/v<NODE>-x64-<HASH>-0. When the directory is owned by a different user (e.g., created by a previous root-owned install or by a shared cache from another user on the same host), the prune fails:The script handles this with a try/catch that emits a warning, but the warning misleads users into thinking something is broken.
Impact
Cosmetic. Postinstall completes successfully; the WARN just adds noise during the upgrade workflow. Particularly visible when the v5.2 upgrade procedure prescribes running
node scripts/postinstall-bundled-plugins.mjsmanually withOPENCLAW_EAGER_BUNDLED_PLUGIN_DEPS=1after--ignore-scriptsinstall.Proposed fix
In the catch block, check
err.code === "EACCES"and silently skip:Alternative: prefix the cache path with the current uid (e.g.
/tmp/node-compile-cache-${process.getuid()}/...) so each user has its own cache, sidestepping the shared-cache permission issue entirely.Repro
npm install -g [email protected] --ignore-scriptscd /usr/lib/node_modules/openclaw && node scripts/postinstall-bundled-plugins.mjsnpm install -g [email protected] --ignore-scriptsEnvironment
/tmp/node-compile-cache/v24.13.0-x64-cf738c9d-0