Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#60,174 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, node.js, typescript
Ambito
cli, devtools

Direzione di ricerca

Inizia con l’installer curl v2 e con l’installer integrato in opencode upgrade --method curl; segui come package_scope, package_name e filename formano l’URL del tarball npm. Confronta l’URL 200 funzionante dell’issue con l’URL 404 che non funziona, quindi verifica che l’installer usi il nome completo del pacchetto nel percorso e possa scaricare il tarball della piattaforma richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
221k
Fork
29.6k
Merge medio
5h 32m
PR unite (30g)
492

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.