Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Corepack incorrectly selects prerelease/dev versions of pnpm when no version is specified

Offen
#774 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

  • #800 von @AMDphreak — ohne Merge geschlossen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
nodejs, typescript
Bereich
cli, devtools

Rechercherichtung

Beginne damit, den Auflösungspfad von corepack use pnpm nachzuverfolgen und zu untersuchen, wie es die package.json von pnpm liest; reproduziere das Verhalten mit der hier beschriebenen Umgebung aus Node.js 20, Corepack 0.34.4 und Alpine. Als abgeschlossen gilt die Aufgabe, wenn eine nicht angegebene pnpm-Anforderung die neueste stabile Version auswählt und deren aktuellen Binary-Einstiegspfad anstelle eines fest codierten Legacy-Pfads verwendet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

After some discussion on the pnpm issue (https://github.com/pnpm/pnpm/issues/10214), it turns out the problem is not caused by a faulty pnpm release, pnpm v11 has changed its binary entry path from bin/pnpm.cjs to bin/pnpm.mjs., so the development build 11.0.0-dev.1005 is not faulty. Corepack is expecting the old path and fails.

So the issue appears to be:

  • Corepack’s version resolution prefers a dev build over the latest stable
  • Corepack seems to rely on a hardcoded pnpm binary path instead of reading the correct bin path from package.json.

As a workaround I'm currently using corepack use [email protected] or corepack use pnpm@latest (or latest-9, latest-10 etc.)

Leaving this update here so the root cause is clearer.

Originally posted by @tkesici in #772

Problem

When running corepack use pnpm, Corepack unexpectedly selects and installs a prerelease development build of pnpm (11.0.0-dev.1005) instead of the latest stable version .

This leads to failure because pnpm v11 is not stable yet and its structure differs from the current pnpm 10.x series.

Expected Behavior

If no version is specified, Corepack should prefer the latest stable release of pnpm (e.g 10.x)

Actual Behavior

corepack use pnpm resolves to: Installing [email protected]...

Environment

Node.js: 20 (node:20-alpine)

Corepack: 0.34.4

OS: Alpine Linux

Vorherrschende Sprache
TypeScript
Sterne
3.8k
Forks
282
Ø Merge
3 Std. 21 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/corepack

Alle Issues in nodejs/corepack

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.