global update silently drops a platform-specific optional dependency
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 10.3k
- Fork
- 5k
- Merge trung bình
- 4 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 26
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của npm/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endingsCó thể đã có người làm @saruk-vedant đã nhận 7 ngày trước. Đang mởBug Needs Triage Triage Requested
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG] npm pkg delete removes the first array item for a nonexistent propertyCó thể đã có người làm @drawliin đã nhận 42 ngày trước. Đang mởcmd:delete Priority 3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings loggedCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởEngineering Priority 1
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 2 ngày
-
`npm audit signatures` does not report how many packages it skipped for want of registry keysCó thể đã có người làm @greenlincoln05 đã nhận 63 ngày trước. Đang mởPriority 3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
docs: add SECURITY.md vulnerability reporting policyCó thể đã có người làm @AK-Lmn đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
flisk-sh/linux2wasm#12 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
possible bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Mintplex-Labs/anything-llm#7388 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 1 ngày
-
v6: Minified bootstrap.min.css is missing header infoCó thể đã có người làm @lazerg đã nhận hôm nay. Đang mởbug build confirmed has-pr v6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
githubnext/gh-aw-workshop#6332 ·
Maintainer thường phản hồi trong vòng 1 ngày