Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

install/upgrade: tarball URL for @opencode scoped packages is missing the package-name segment — curl installs/upgrades 404

Đang mở Phù hợp với người mới
#60,174 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, node.js, typescript
Lĩnh vực
cli, devtools

Hướng nghiên cứu

Bắt đầu với trình cài đặt curl v2 và trình cài đặt được nhúng trong opencode upgrade --method curl; theo dõi cách package_scope, package_name và filename tạo thành URL của gói tarball npm. Đối chiếu URL 200 hoạt động trong issue với URL 404 bị lỗi, sau đó xác minh trình cài đặt sử dụng tên gói đầy đủ trong đường dẫn và có thể tải xuống gói tarball cho nền tảng được yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The v2 curl installer (and the installer embedded in opencode upgrade --method curl) constructs the npm registry tarball URL from the bare package scope, dropping the package-name path segment. Every curl-method install or upgrade of @opencode/cli-<target> since the scope migration to @opencode 404s before the binary is ever downloaded.

Environment

  • opencode version: 2.0.30 (bundled installer), upgrading to 2.2.1 via opencode upgrade 2.2.1 --method curl
  • OS: Windows 11 Home x64 (build 10.0.26300); opencode running in WSL2 Ubuntu (bash)
  • Terminal: Windows Terminal / bash in WSL
  • Shell: /bin/bash
  • Install/channel: latest, v2 curl installer

Reproduction

  1. Run opencode upgrade 2.2.1 --method curl
    (equivalently: curl -fsSL https://opencode.ai/v2/install | bash -s -- --version 2.2.1)
  2. The installer resolves version 2.2.1 from the update endpoint (package: "@opencode/cli", package_scope: "@opencode")
  3. It builds the tarball URL as https://registry.npmjs.org/@opencode/-/cli-linux-x64-2.2.1.tgz and fetches it
  4. curl exits 22: The requested URL returned error: 404

Root cause

For npm scoped packages the registry tarball path must include the full package name:

https://registry.npmjs.org/@opencode/cli-linux-x64/-/cli-linux-x64-2.2.1.tgz   → 200

but the script assembles the URL from the bare scope:

https://registry.npmjs.org/@opencode/-/cli-linux-x64-2.2.1.tgz   → 404

($package_scope is @opencode after ${package%/cli}, and $filename is only cli-<target>-<version>.tgz — the cli-linux-x64 segment between scope and /-/ is lost.)

Expected Behavior

The installer downloads the platform tarball from the correct registry path and installs the requested version.

Actual Behavior

curl fails with HTTP 404; opencode upgrade reports Upgrade failed — The OpenCode installer failed — curl: (22) The requested URL returned error: 404. No version can be installed through the curl method.

Additional Context

  • Confirmed the published tarball exists and is fetchable: https://registry.npmjs.org/@opencode/cli-linux-x64/-/cli-linux-x64-2.2.1.tgz → 200
  • Affects every curl-method install/upgrade of any @opencode/cli-<target> package since the scope migration (2.2.0+), both with and without an explicit --version
  • Workaround: download the correct tarball manually and place package/bin/opencode into ~/.opencode/bin/opencode
  • Related: #55907 / #55918 (the mirrored-networking port issue I hit right after upgrading), #57413 (same symptom — missing artifact — different cause)
  • Suggested fix: derive the tarball URL from package_name ($package_scope/cli-$target) instead of $package_scope, i.e. https://registry.npmjs.org/$package_name/-/$filename
Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
5 giờ 32 phút
Pull request đã merge (30 ngày)
492

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.