惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
L
LangChain Blog
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
P
Proofpoint News Feed
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
I
InfoQ
月光博客
月光博客
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
D
Docker
B
Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(scripts): harden Windows native opus install · opencl...
vincentkoc · 2026-05-25 · via Recent Commits to openclaw:main

@@ -2,43 +2,70 @@ import { spawnSync } from "node:child_process";

22

import { existsSync } from "node:fs";

33

import path from "node:path";

44

import { fileURLToPath } from "node:url";

5+

import { resolvePnpmRunner } from "./pnpm-runner.mjs";

5667

const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");

78

const opusDir = path.join(root, "node_modules", "@discordjs", "opus");

899-

if (!existsSync(path.join(opusDir, "package.json"))) {

10-

console.error(

11-

"Missing node_modules/@discordjs/opus. Run pnpm install first, then retry this opt-in installer.",

12-

);

13-

process.exit(1);

10+

export function resolveNativeOpusInstallCommand(params = {}) {

11+

return resolvePnpmRunner({

12+

comSpec: params.comSpec,

13+

nodeExecPath: params.nodeExecPath,

14+

npmExecPath: params.npmExecPath,

15+

platform: params.platform,

16+

pnpmArgs: [

17+

"--dir",

18+

params.opusDir,

19+

"exec",

20+

"node-pre-gyp",

21+

"install",

22+

"--fallback-to-build",

23+

],

24+

});

1425

}

152616-

const install = spawnSync(

17-

"pnpm",

18-

["--dir", opusDir, "exec", "node-pre-gyp", "install", "--fallback-to-build"],

19-

{

27+

function isDirectRun(metaUrl = import.meta.url, argvPath = process.argv[1]) {

28+

return Boolean(argvPath) && path.resolve(argvPath) === fileURLToPath(metaUrl);

29+

}

30+31+

export function main() {

32+

if (!existsSync(path.join(opusDir, "package.json"))) {

33+

console.error(

34+

"Missing node_modules/@discordjs/opus. Run pnpm install first, then retry this opt-in installer.",

35+

);

36+

process.exit(1);

37+

}

38+39+

const install = resolveNativeOpusInstallCommand({ opusDir });

40+

const installResult = spawnSync(install.command, install.args, {

41+

cwd: root,

42+

env: install.env ?? process.env,

43+

stdio: "inherit",

44+

shell: install.shell,

45+

windowsVerbatimArguments: install.windowsVerbatimArguments,

46+

});

47+48+

if (installResult.status !== 0) {

49+

console.error(

50+

"Failed to install @discordjs/opus for the active Node runtime. Use Node 22 for the upstream macOS arm64 prebuild, or install a node-gyp toolchain for source builds.",

51+

);

52+

process.exit(installResult.status ?? 1);

53+

}

54+55+

const verify = spawnSync(process.execPath, ["-e", 'require("@discordjs/opus")'], {

2056

cwd: root,

2157

env: process.env,

2258

stdio: "inherit",

23-

},

24-

);

25-26-

if (install.status !== 0) {

27-

console.error(

28-

"Failed to install @discordjs/opus for the active Node runtime. Use Node 22 for the upstream macOS arm64 prebuild, or install a node-gyp toolchain for source builds.",

29-

);

30-

process.exit(install.status ?? 1);

31-

}

59+

});

326033-

const verify = spawnSync(process.execPath, ["-e", 'require("@discordjs/opus")'], {

34-

cwd: root,

35-

env: process.env,

36-

stdio: "inherit",

37-

});

61+

if (verify.status !== 0) {

62+

console.error("@discordjs/opus installed, but the active Node runtime still cannot load it.");

63+

process.exit(verify.status ?? 1);

64+

}

386539-

if (verify.status !== 0) {

40-

console.error("@discordjs/opus installed, but the active Node runtime still cannot load it.");

41-

process.exit(verify.status ?? 1);

66+

console.log("native opus ok");

4267

}

436844-

console.log("native opus ok");

69+

if (isDirectRun()) {

70+

main();

71+

}