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
相关推荐
Ai尚研修-贾莲8 分钟前
基于Claude Code与Codex双Agent协作的WebGIS全链路开发
codex·webgis·ai-agent·claude code·maplibre·openclaw·leaflet交互地图
一叶飘零_sweeeet1 小时前
Codex 与 Claude Code 深度拆解:两代 AI 编程智能体的技术本质与 Java 实战指南
java·ai·codex·claude code
智脑API平台7 小时前
Codex CLI一次改多个文件安全吗?提交前检查清单与PR验证流程
安全·cli·codex
进击的雷神2 天前
埋点skill使用与自动化
appium·自动化·埋点·codex·app自动化
仙逆GPT2 天前
使用 Codex 处理项目时,怎样减少无关修改和重复返工?
人工智能·chatgpt·codex
AI大模型-小华2 天前
2026 ChatGPT Pro + Codex 高阶开发教程:AGENTS.md、Worktree 与自动测试闭环
自动化测试·ai编程·codex·chatgpt pro·worktree·agents.md·gpt-5.5
lincats3 天前
上下文工程:AI 智能体为什么离不开它?
codex·vibe coding·claude code
kebeiovo3 天前
2026超稳国内AI中转API平台|支持GPT/Claude/Gemini/Codex 免费可用
gpt·claude·codex·api key·中转站
ん贤3 天前
Alissa 保姆配置篇
人工智能·codex
梦想的初衷~3 天前
【科研自动化实战】Codex × Claude Code × OpenClaw × Hermes:四位AI研究员的科研协作流水线搭建指南
人工智能·codex·claude code·openclaw·科研自动化·agent协作·ai科研助手