兼容多个nodejs 版本共存的情况

2025-12-29T22:39:49.356Z POST /api/providers/claude-code-acp/test

[TestProvider] ACP - Testing provider Claude Code (ACP) (command: claude-code-acp)

file:///Users/x/.nvm/versions/node/v22.18.0/lib/node_modules/@zed-industries/claude-code-acp/dist/acp-agent.js:11

import packageJson from "../package.json" with { type: "json" };

^^^^

SyntaxError: Unexpected token 'with'

at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:115:18)

at ESMLoader.moduleProvider (node:internal/modules/esm/loader:293:14)

Node.js v17.6.0
——-
我的电脑因为工作需要有多个版本node,默认是node17,但是这个版本太老了,好多package是运行不起来的
我参考了

https://feedback.alma.now/p/codex-cliacp-wu-fa-pei-zhi-cheng-gong
这个帖子,先用nvm 切换到node22, 然后通过命令行运行alma,但是出现了上面这个错误,明显alma在启动的时候没有用当前环境的node22. 所以acp什么的都没有反应一直报错。
想问问有没有什么办法强制alma用某一个版本的node么?还是说这个需要额外的修复?
谢谢!

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
🐛

Bug Reports

Date

2 months ago

Author

Diwei Zhu

Subscribe to post

Get notified by email when there are changes.