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

The Corepack install hint fails on Node.js 25 and later

Chiusa Adatta ai principianti
#15 0 commenti 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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js

Direzione di ricerca

Leggi lib/package-managers.js per le indicazioni di installazione di PACKAGE_MANAGERS e lib/commands.js per vedere come runCommand() le mostra e accetta dipendenze iniettate. Controlla i test esistenti per queste indicazioni, poi verifica i comandi suggeriti per le versioni di Node.js precedenti alla 25 e dalla 25 in poi. Il lavoro è completato quando le indicazioni per pnpm e Yarn funzionano con tutte le versioni di Node.js supportate ed entrambi i casi sono coperti dai test.

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

Descrizione

bug
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
  1. 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
    
  2. Start the CLI, open pnpm-app and run hello:

    DEV_WORKSPACE_CONFIG=/tmp/dws-corepack/config.json \
      npx -p @modulane/[email protected] dws --workspace /tmp/dws-corepack
    
  3. 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, then corepack enable pnpm, or npm install --global pnpm;
  • on earlier versions: the current text.
Where
Suggested fix
  1. Choose the pnpm and Yarn hints from the running Node.js major version (process.versions.node). It can be passed in the same way commands.js already accepts injected dependencies, so tests can check both texts.
  2. Alternatively, keep a single text that works everywhere: npm install --global corepack before corepack enable. That is one step longer on Node.js 24 and earlier, where it is not needed.
  3. 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-cli 0.5.0 from npm. lib/ is identical on main at dfccb6b.
  • The message above comes from PACKAGE_MANAGERS and runCommand(). I did not run the CLI on Node.js 25 or 26 myself; Corepack's removal is documented in the 25.0.0 changelog.
Lingua principale
JavaScript
Stelle
0
Fork
0
Merge medio
43m
PR unite (30g)
20

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 modulane/dev-workspace-cli

Tutte le issue di modulane/dev-workspace-cli

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.