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

Corepack hardcodes pnpm binary path instead of reading package.json bin field (breaks with pnpm v11)

Offen
#775 8 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
66/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
nodejs, typescript
Bereich
cli, tooling

Rechercherichtung

Beginne damit, die Auflösung von pnpm und die Auswahl der ausführbaren Datei durch Corepack nachzuverfolgen, und vergleiche anschließend den fest codierten Pfad mit dem Feld bin in pnpm's package.json. Reproduziere das Problem mit Node.js 20, Corepack 0.34.4 und pnpm v11; als erledigt gilt es, wenn pnpm v11 seinen bin/pnpm.mjs-Eintrag verwendet und vorhandene pnpm-Versionen weiterhin funktionieren.

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

Corepack appears to rely on a hard-coded pnpm binary path (bin/pnpm.cjs) instead of reading the bin field from pnpm’s package.json.

pnpm v11 changed its binary entry from bin/pnpm.cjs to bin/pnpm.mjs (https://github.com/pnpm/pnpm/issues/10214#issuecomment-3566728733), so when corepack installs pnpm v11, pnpm cannot start and the process fails.

Expected Behavior

Corepack should read the bin property from pnpm’s package.json to determine the correct executable path

Actual Behavior

Corepack assumes the binary always exists under bin/pnpm.cjs, which is no longer valid for pnpm v11.

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.