global update silently drops a platform-specific optional dependency
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
Start by tracing the global update path for npm install -g and how it handles aliased optionalDependencies; compare it with the local-install fix in issue #8645. The report gives a reproducible case with @openai/codex@latest on npm 11.18.0, where the platform package is missing after a successful update but returns after uninstalling and reinstalling. Identify the relevant tests for global updates and add coverage that verifies the platform dependency remains installed.
索引モデルが issue の本文から書いたものです。
説明
https://github.com/npm/cli/issues/8628#issuecomment-6076454666
Still seeing this (or a closely related variant) on npm 11.18.0 — a global update silently drops a platform-specific optional dependency and exits 0. Posting here since #8645 supposedly fixed the local-install case in 11.6.3/11.6.4; the global path still appears affected.
Environment
- npm: 11.18.0
- Node.js: v22.23.1
- OS: Linux x86_64
- prefix:
~/.npm-global(non-default, vianpm config set prefix)
What happened
-
@openai/codexwas already installed globally at an older version. -
Ran
npm install -g @openai/codex@latest(this is also what Codex's built-in updater runs). Output:changed 2 packages in 29s, exit code 0. -
@openai/[email protected]declares its platform binaries through aliased optionalDependencies:"optionalDependencies": { "@openai/codex-linux-x64": "npm:@openai/[email protected]", "@openai/codex-linux-arm64": "npm:@openai/[email protected]", ... } -
After the update,
~/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64was missing entirely, so the package's CLI fails at runtime with:Error: Missing optional dependency @openai/codex-linux-x64. Reinstall Codex: npm install -g @openai/codex@latestA plain re-run of
npm install -g @openai/codex@latest(as the error message suggests) does not fix it — it again reports success while leaving the optional dep out.
Workaround that worked
npm uninstall -g @openai/codex && npm install -g @openai/codex@latest
A full uninstall + reinstall restores @openai/codex-linux-x64 correctly.
Happy to run diagnostics (npm ls -g, arborist logs, etc.) if helpful.
- 主要言語
- JavaScript
- スター
- 10.3k
- フォーク
- 5k
- 平均マージ
- 4日 11時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
npm/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings対応中かも @saruk-vedant が 7 日前に担当しました。 オープンBug Needs Triage Triage Requested
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
[BUG] npm pkg delete removes the first array item for a nonexistent property対応中かも @drawliin が 42 日前に担当しました。 オープンcmd:delete Priority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings logged再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンEngineering Priority 1
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
`npm audit signatures` does not report how many packages it skipped for want of registry keys対応中かも @greenlincoln05 が 63 日前に担当しました。 オープンPriority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#6332 ·
メンテナーはふだん 1 日以内に返信
-
App Designer bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
avniproject/avni-webapp#1858 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 96/100
hiero-ledger/hiero-sdk-js#4834 ·
メンテナーはふだん 1 日以内に返信
-
[组件名称] 描述问题的标题オープン🐞 bug 🧐 unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Tencent/tdesign-miniprogram#4744 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Y-axis tooltip hides near the bottom of the plot while the y crosshair stays visible対応中かも @lazerg が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apexcharts/apexcharts.js#5449 ·
メンテナーはふだん 3 日以内に返信