codex升级之后报错

今天升级到codex 0.134.0之后运行报错:

shell 复制代码
$ codex
file:///home/simon/.npm-global/lib/node_modules/@openai/codex/bin/codex.js:122
  throw new Error(
        ^

Error: Missing optional dependency @openai/codex-linux-arm64. Reinstall Codex: npm install -g @openai/codex@latest
    at file:///home/simon/.npm-global/lib/node_modules/@openai/codex/bin/codex.js:122:9
    at ModuleJob.run (node:internal/modules/esm/module_job:430:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Node.js v24.14.0

按照提示重装还是在安装过程中报错:

shell 复制代码
# 先卸载并清除缓存
npm uninstall -g @openai/codex
npm cache clean --force

重装报错信息:

shell 复制代码
npm install -g @openai/codex@latest --verbose  --registry=https://registry.npmjs.org/
npm verbose cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@11.9.0
npm info using node@v24.14.0
npm verbose title npm install @openai/codex@latest
npm verbose argv "install" "--global" "@openai/codex@latest" "--loglevel" "verbose" "--registry" "https://registry.npmjs.org/"
npm verbose logfile logs-max:10 dir:/home/simon/.npm/_logs/2026-05-27T19_20_16_786Z-
npm verbose logfile /home/simon/.npm/_logs/2026-05-27T19_20_16_786Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/@openai%2fcodex 1409ms (cache miss)
npm http cache https://registry.npmjs.org/@openai%2fcodex 135ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 164ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 585ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 874ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 546ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 430ms (cache hit)
npm http cache https://registry.npmjs.org/@openai%2fcodex 1586ms (cache hit)
npm http cache @openai/codex@https://registry.npmjs.org/@openai/codex/-/codex-0.134.0.tgz 0ms (cache hit)
npm http cache @openai/codex-linux-arm64@https://registry.npmjs.org/@openai/codex/-/codex-0.134.0-linux-arm64.tgz 0ms (cache hit)
npm verbose reify failed optional dependency /home/simon/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-arm64

changed 1 package in 7s
npm verbose cwd /home/simon/mimusic
npm verbose os Linux 6.12.11-edge-sunxi64
npm verbose node v24.14.0
npm verbose npm  v11.9.0
npm verbose exit 0
npm info ok

看提示就是下载主程序包失败,反复尝试不同版本多次依然不行。

然后使用wget单独下载此文件看到了如下信息:

shell 复制代码
wget -O codex-linux-arm64.tgz \
https://registry.npmjs.org/@openai/codex/-/codex-0.134.0-linux-arm64.tgz
--2026-05-28 03:27:42--  https://registry.npmjs.org/@openai/codex/-/codex-0.134.0-linux-arm64.tgz
正在连接 192.168.123.32:7892... 已连接。
已发出 Proxy 请求,正在等待回应... 200 OK
长度:83530982 (80M) [application/octet-stream]
正在保存至: "codex-linux-arm64.tgz"

codex-linux-arm64.tgz                   6%[===>                                                                     ]   4.86M  5.26MB/s  用时 0.9s

2026-05-28 03:27:44 (5.26 MB/s) - 在 5098688/83530982 字节处发生读取错误 (Error decoding the received TLS packet.)。重试中。

--2026-05-28 03:27:45--  (尝试次数: 2)  https://registry.npmjs.org/@openai/codex/-/codex-0.134.0-linux-arm64.tgz
正在连接 192.168.123.32:7892... 已连接。
已发出 Proxy 请求,正在等待回应... 206 Partial Content
长度:83530982 (80M),剩余 78432294 (75M) [application/octet-stream]
正在保存至: "codex-linux-arm64.tgz"

codex-linux-arm64.tgz                  12%[++++===>                                                                 ]   9.68M  5.15MB/s  用时 0.9s

2026-05-28 03:27:47 (5.15 MB/s) - 在 10151744/83530982 字节处发生读取错误 (Error decoding the received TLS packet.)。重试中。

......(此处省略n次重试)
--2026-05-28 03:29:57--  (尝试次数:16)  https://registry.npmjs.org/@openai/codex/-/codex-0.134.0-linux-arm64.tgz
正在连接 192.168.123.32:7892... 已连接。
已发出 Proxy 请求,正在等待回应... 206 Partial Content
长度:83530982 (80M),剩余 2652774 (2.5M) [application/octet-stream]
正在保存至: "codex-linux-arm64.tgz"

codex-linux-arm64.tgz                 100%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==>]  79.66M  3.09MB/s  用时 0.8s

2026-05-28 03:29:58 (3.09 MB/s) - 已保存 "codex-linux-arm64.tgz" [83530982/83530982])

也就是说下载这个包因为npm没有重试机制,中间下载失败就跳过了,导致codex包无法正确下载。

于是怀疑是代理问题,再次卸载,使用国内npm镜像,就成功了。

shell 复制代码
npm install -g @openai/codex@0.134.0 --include=optional --registry=https://registry.npmmirror.com --verbose
npm verbose cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@11.9.0
npm info using node@v24.14.0
npm verbose title npm install @openai/codex@0.134.0
npm verbose argv "install" "--global" "@openai/codex@0.134.0" "--include" "optional" "--registry" "https://registry.npmmirror.com" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/home/simon/.npm/_logs/2026-05-27T19_35_28_002Z-
npm verbose logfile /home/simon/.npm/_logs/2026-05-27T19_35_28_002Z-debug-0.log
npm http cache https://registry.npmmirror.com/@openai%2fcodex 139ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 117ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 453ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 871ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 180ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 784ms (cache hit)
npm http cache https://registry.npmmirror.com/@openai%2fcodex 1646ms (cache hit)
npm http cache @openai/codex@https://registry.npmmirror.com/@openai/codex/-/codex-0.134.0.tgz 0ms (cache hit)
npm http cache @openai/codex-linux-arm64@https://registry.npmmirror.com/@openai/codex/-/codex-0.134.0-linux-arm64.tgz 0ms (cache hit)
npm http fetch GET 200 https://cdn.npmmirror.com/packages/%40openai/codex/0.134.0/codex-0.134.0.tgz 440ms (cache miss)
npm http fetch GET 200 https://cdn.npmmirror.com/packages/%40openai/codex/0.134.0-linux-arm64/codex-0.134.0-linux-arm64.tgz 10536ms (cache miss)

changed 2 packages in 15s
npm verbose cwd /tmp/codex
npm verbose os Linux 6.12.11-edge-sunxi64
npm verbose node v24.14.0
npm verbose npm  v11.9.0
npm verbose exit 0
npm info ok
simon@iclaw-e8a384:/tmp/codex$ codex --version
codex-cli 0.134.0
相关推荐
zhyongrui8 小时前
Codex 桌面端汉化:从菜单到主界面的实现思路
chatgpt·codex·汉化·easygpt
枫叶丹48 小时前
AI 的记忆不是数据库:长期个性化如何避免过期与污染
人工智能·chatgpt·开源·agent·codex
带刺的坐椅9 小时前
什么样的编码智能体值得信任?——SolonCode 的设计取舍
codex·claudecode·traecn·soloncode·zcode
BryceBorder7 天前
Agent Memory 不只是聊天记录:手搓三大记忆系统
后端·agent·面经·codex·claude code·agent memory
O。O蛋黄酥啊7 天前
Claude Code 记忆机制全拆解:Auto Memory 与 CLAUDE.md 双轨解析
大模型·agent·memory·claude·codex·记忆
JavaPub-rodert7 天前
Codex 里的 GPT-6 Astra、GPT-5.6 Sol、Terra、Luna 怎么选?
ai·codex·skill
Ztiddler7 天前
Codex重新连接解决方法
chatgpt·openai·codex
仙逆GPT8 天前
ChatGPT、Codex工程决策:单Agent什么时候够用,什么时候才值得切到多Agent?
codex·ai agent·chatgptplus·多agent·chatgptpro