diff --git a/package.json b/package.json index 2bfb8c32c..f65e3c349 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "icons": "zx scripts/generate-icons.mjs", "package": "vite build && zx scripts/bundle-openclaw.mjs && zx scripts/bundle-openclaw-plugins.mjs && zx scripts/bundle-preinstalled-skills.mjs", "package:mac": "pnpm run package && electron-builder --mac --publish never", + "package:mac:local": "SKIP_PREINSTALLED_SKILLS=1 pnpm run package && electron-builder --mac --publish never", "package:win": "pnpm run package && electron-builder --win --publish never", "package:linux": "pnpm run package && electron-builder --linux --publish never", "release": "pnpm run uv:download && pnpm run package && electron-builder --publish always", diff --git a/scripts/bundle-openclaw.mjs b/scripts/bundle-openclaw.mjs index 436dbc1c1..8251d0a39 100644 --- a/scripts/bundle-openclaw.mjs +++ b/scripts/bundle-openclaw.mjs @@ -133,6 +133,12 @@ queue.push({ nodeModulesDir: openclawVirtualNM, skipPkg: 'openclaw' }); const SKIP_PACKAGES = new Set([ 'typescript', '@playwright/test', + // @discordjs/opus is a native .node addon compiled for the system Node.js + // ABI. The Gateway runs inside Electron's utilityProcess which has a + // different ABI, so the binary fails with "Cannot find native binding". + // The package is optional — openclaw gracefully degrades when absent + // (only Discord voice features are affected; text chat works fine). + '@discordjs/opus', ]); const SKIP_SCOPES = ['@cloudflare/', '@types/']; let skippedDevCount = 0; diff --git a/scripts/bundle-preinstalled-skills.mjs b/scripts/bundle-preinstalled-skills.mjs index cfee66237..5ba38af2f 100644 --- a/scripts/bundle-preinstalled-skills.mjs +++ b/scripts/bundle-preinstalled-skills.mjs @@ -102,6 +102,12 @@ async function fetchSparseRepo(repo, ref, paths, checkoutDir) { } echo`Bundling preinstalled skills...`; + +if (process.env.SKIP_PREINSTALLED_SKILLS === '1') { + echo`⏭ SKIP_PREINSTALLED_SKILLS=1 set, skipping skills fetch.`; + process.exit(0); +} + const manifestSkills = loadManifest(); rmSync(OUTPUT_ROOT, { recursive: true, force: true });