The Corepack install hint fails on Node.js 25 and later
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, node.js
- Bereich
- cli, developer-experience
Rechercherichtung
Lies lib/package-managers.js für die Installationshinweise von PACKAGE_MANAGERS und lib/commands.js dafür, wie runCommand() sie anzeigt und injizierte Abhängigkeiten akzeptiert. Sieh dir die bestehenden Tests für diese Hinweise an und prüfe dann die empfohlenen Befehle für Node.js-Versionen vor 25 und ab 25. Fertig, wenn die Hinweise zu pnpm und Yarn mit allen unterstützten Node.js-Versionen funktionieren und beide Pfade durch Tests abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
When a project's package manager is not installed, the CLI suggests how to install it. For pnpm and Yarn, the first suggestion is Corepack:
Could not find pnpm, which this project uses. Install it with "corepack enable pnpm" or "npm install --global pnpm".
Node.js no longer ships Corepack since 25.0.0 (nodejs/node#57617, "build: stop distributing Corepack", semver-major; nodejs/node#59835 removed it from the release tarballs). Node.js 26 becomes the active LTS line on 2026-10-28, so a growing share of users will see a first suggestion that fails with corepack: command not found.
The second suggestion, npm install --global …, still works, so nobody is blocked. The first step offered is simply wrong on current Node.js versions.
Steps to reproduce
-
On Node.js 25 or 26, with pnpm not installed, create a pnpm project in a scratch workspace:
mkdir -p /tmp/dws-corepack/pnpm-app echo '{"packageManager":"[email protected]","scripts":{"hello":"echo hello"}}' \ > /tmp/dws-corepack/pnpm-app/package.json -
Start the CLI, open
pnpm-appand runhello:DEV_WORKSPACE_CONFIG=/tmp/dws-corepack/config.json \ npx -p @modulane/[email protected] dws --workspace /tmp/dws-corepack -
Follow the first suggestion:
corepack enable pnpm.
Actual behaviour
The CLI shows:
Could not start command: Could not find pnpm, which this project uses. Install it with "corepack enable pnpm" or "npm install --global pnpm".
On Node.js 25 and later the corepack command is not installed, so the first suggestion fails.
Expected behaviour
The suggestion works on every Node.js version that engines allows. For example:
- on Node.js 25 and later:
npm install --global corepack, thencorepack enable pnpm, ornpm install --global pnpm; - on earlier versions: the current text.
Where
PACKAGE_MANAGERSinpackage-managers.jsholds the install hints;runCommand()incommands.jsshows them.
Suggested fix
- Choose the pnpm and Yarn hints from the running Node.js major version (
process.versions.node). It can be passed in the same waycommands.jsalready accepts injected dependencies, so tests can check both texts. - Alternatively, keep a single text that works everywhere:
npm install --global corepackbeforecorepack enable. That is one step longer on Node.js 24 and earlier, where it is not needed. - The ROADMAP item "show an actionable error naming the tool and how to install it (for example,
corepack enable)" could mention the same.
I'm happy to open a PR with whichever option you prefer.
Environment
@modulane/dev-workspace-cli0.5.0 from npm.lib/is identical onmainat dfccb6b.- The message above comes from
PACKAGE_MANAGERSandrunCommand(). I did not run the CLI on Node.js 25 or 26 myself; Corepack's removal is documented in the 25.0.0 changelog.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 0
- Forks
- 0
- Ø Merge
- 56 Min.
- Gemergte PRs (30 T.)
- 23
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modulane/dev-workspace-cli
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
modulane/dev-workspace-cli#26 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
modulane/dev-workspace-cli#60 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 22/100
modulane/dev-workspace-cli#54 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 43/100
modulane/dev-workspace-cli#53 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
modulane/dev-workspace-cli#52 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modulane/dev-workspace-cli
Ähnliche Issues
-
API: `tsc.exe` opens a visible console window on Windows when the parent process has no consoleOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/TypeScript#65083 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
openfoodfacts/open-prices-frontend#2496 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
[metro-file-map] An error a watcher backend reports ends the server, since nothing listens for itOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 2 Tagen
-
needs:triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag