最近在用 Remotion 制作视频时,遇到了一个奇怪的问题。
问题现象#
npm run devbash> test@1.0.0 dev
> npx remotion studio
Server ready - Local: http://localhost:3001
Error: spawn Unknown system error -88
at ChildProcess.spawn
at makeBrowserRunner
at HeadlessBrowser.create
at launchChrometextnpx remotion compositionsbashError: spawn Unknown system error -88text说明问题甚至发生在读取 Composition 之前。
环境信息#
最初环境:
macOS 27.0
Apple Silicon (arm64)
Node.js v26.3.0
Google Chrome 149.0.7827.115
Remotion 4.0.242textNode 版本太高?#
由于使用的是较新的 Node 26,于是首先怀疑兼容性问题。
brew install node@22
brew unlink node
brew link --overwrite --force node@22bashnode -vbashv22.23.0text问题依旧,排除 Node 版本导致的问题。
Chrome 的问题?#
验证 Chrome 是否正常:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --versionbashGoogle Chrome 149.0.7827.115text验证 Node 是否能够启动 Chrome:
node -e "require('child_process').spawn('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',['--version'],{stdio:'inherit'})"bashGoogle Chrome 149.0.7827.115text-
Chrome 安装正常
-
Node 可以正常 spawn Chrome
-
系统权限没有问题
Remotion 的问题?#
npx remotion compositionsbashBundled code
↓
启动浏览器
↓
崩溃text问题明确发生在:
launchChrome()text查看版本:
npm list remotionbashremotion@4.0.242text属于较旧版本,升级:
npm install remotion@latest \
@remotion/cli@latest \
@remotion/renderer@latestbash升级后:
@remotion/cli 4.0.481text再次执行:
npx remotion compositionsbash出现:
This version of Remotion uses Chrome version 149.0.7790.0,
but the installed one differs.
Re-downloading.text喵喵喵
rm -rf ~/.cache/remotionbash写在最后#
当 Remotion 报浏览器相关错误时,不一定是代码问题。很多时候是 Remotion 自带的浏览器组件与当前系统或 Chrome 版本不匹配。先升级 Remotion,再让它重新下载 Headless Chrome,往往比反复修改代码更有效。