Skip to content

build(package.json): canvas 改成可选依赖,Windows on Arm 上装得完 - #419

Merged
Phantivia merged 3 commits into
mainfrom
fix/win-arm64-install
Nov 19, 2026
Merged

Phantivia merged 3 commits into
mainfrom
fix/win-arm64-install

Conversation

@Phantivia

@Phantivia Phantivia commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

README 的快速开始(corepack pnpm install、pnpm start)在 Windows on Arm 上走不通:pnpm install 以退出码 1 结束。

改动

  • canvas 从 dependencies 挪到 optionalDependencies,锁文件随之更新。
    • canvas 3.2.3 没有 win32-arm64 的预编译包,安装脚本转去 node-gyp 编译,机器上没有 Python 和编译工具链时失败(gyp ERR! find Python),整个安装随之失败。
    • 只有 prismarine-viewer 用到它。viewer 是按需加载的,起不来只记一条警告(src/worlds/minecraft/bridge.ts)。作为可选依赖,编译失败时 pnpm 跳过它继续装。
    • 有预编译包的平台装出来的东西不变。
  • 说明写在各自的页:docs/development.md 写 canvas 是可选依赖、没有预编译包的平台编译不成就跳过;src/worlds/minecraft/README.md 讲画面的那节写 viewer 要 canvas,没装上时起不来、只记警告。

不做的:给 llamacpp 的发行表补 opencl-adreno-arm64 后端;ci.yml 加 windows-11-arm。

实测

本机没有 Arm 真机,用 QEMU 在 x64 上仿真了一台 Windows 11 Arm64(26300)虚拟机,Node 22.23.2 arm64。

  • 改之前:corepack pnpm install 在 canvas 的安装脚本上失败,退出码 1。
  • 改之后:canvas 仍然编译失败,安装继续并以退出码 0 结束。pnpm start mybot 构建出 WebUI(esbuild 和 tailwind 的 arm64 包正常)、建好默认部署,http://127.0.0.1:7788/ 就绪。
  • 写一个 llamacpp 端点(外部模式,指向另一台机器上的 llama-server)并设为 active 后,/api/status 里连接就绪;控制台发一句话,模型被调用,write_file、edit_file 在工作区写出了文件。

没验的

  • Arm 真机,以及 llamacpp 的托管模式在 Arm 上下载和启动 cuda-13.4 / cpu 运行时。
  • Minecraft、QQ、bilibili、websearch 这几个 World 在 Arm 上没有启用过。
  • 装了 Python 和 Visual Studio 构建工具的 Arm 机器上 canvas 能否编译成功,没有试。

检查

pnpm run typecheck、pnpm test(5221 通过 4 跳过)本地通过;x64 上 corepack pnpm install 通过。

🤖 Generated with Claude Code

Phantivia and others added 2 commits November 17, 2026 22:39
- canvas 3.2.3 没有 win32-arm64 的预编译包,安装脚本转去 node-gyp 编译,机器上没有 Python 和编译工具链时失败,
  整个 `pnpm install` 以退出码 1 结束,README 的快速开始在 Arm 的 Windows 上走不通。
- 只有 prismarine-viewer 用到它,而 viewer 是按需加载的,起不来只记一条警告(src/worlds/minecraft/bridge.ts)。
  作为可选依赖,编译失败时 pnpm 跳过它继续装。有预编译包的平台装出来的东西不变。
- 验证:Windows 11 Arm64(QEMU 仿真的虚拟机)、Node 22.23.2 arm64 上,改之前 `pnpm install` 退出码 1,
  改之后退出码 0;`pnpm start mybot` 起来 WebUI,接上 llama.cpp 端点后模型调用和 write_file、edit_file 正常。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Comment thread docs/windows.md Resolved
Comment thread docs/windows.md Resolved
- docs/windows.md 的 owner 不含 package.json,那一条删掉;canvas 可选、编译不成就跳过写进
  owner 含 package.json 的 docs/development.md。
- viewer 要 canvas、没装上时起不来只记警告,写进 Minecraft World 自己的 README,共享的 Windows 页
  不描述某个 World 的行为。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先前针对 docs/windows.md 的文档所有权(讨论)和 Layer boundaries(讨论)两条不再成立:canvas 可选依赖写在 docs/development.md(owner 含 package.json),viewer 缺 canvas 时只记警告写在 src/worlds/minecraft/README.md,docs/windows.md 已无这两句。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@Phantivia
Phantivia merged commit 9adae21 into main Nov 19, 2026
4 checks passed
@Phantivia
Phantivia deleted the fix/win-arm64-install branch November 19, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant