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

`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager

Aperta Adatta ai principianti
#2,970 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
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nodejs, typescript
Ambito
cli, tooling

Direzione di ricerca

Il bug riguarda il modo in cui vp create costruisce l'ambiente per il runner dei template: prependToPathToEnvs(..., { ...process.env }) in packages/cli/src/create/discovery.ts passa npm_config_package alla chiamata annidata npx create-vite@latest. Inizia leggendo questa funzione, poi riproduci il problema con il comando nell'issue o con lo snippet execSync. È completato quando l'esecuzione selezionata con npm va a buon fine e le chiavi riservate a npm exec vengono rimosse dall'ambiente del processo figlio, con un test di regressione in discovery.spec.ts.

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

Descrizione

bug
Describe the bug

When vp create runs under npx --package=vite-plus and npm is the selected package manager, the template runner fails with sh: create-vite@latest: command not found (exit 127).

npx --package=vite-plus sets npm_config_package=vite-plus in the environment of vp. vp create copies all of process.env into the template runner environment (packages/cli/src/create/discovery.ts, prependToPathToEnvs(..., { ...process.env })). The nested npx create-vite@latest … reads the inherited npm_config_package, so npm installs vite-plus and looks for a bin named create-vite@latest in it, which does not exist.

The same command succeeds when:

  • the global vp runs it, with no outer npx;
  • pnpm dlx --package vite-plus vp create runs it;
  • pnpm, Yarn, or Bun is the selected package manager;
  • npm_config_package is removed from the environment before vp starts.
Reproduction

No repository is needed. Run from an empty directory.

Steps to reproduce
npx --yes --package vite-plus vp create vite:application --directory app \
  --package-manager npm --no-agent --no-editor --no-git --no-hooks --no-interactive --verbose

Output:

●  Running: npx create-vite@latest app --no-interactive --no-immediate --no-rolldown
npm notice run 'create-vite@latest' app --no-interactive --no-immediate --no-rolldown
sh: create-vite@latest: command not found

Exit code 127. app is not created.

Minimal npm-only reproduction of the mechanism, without Vite+:

npx --yes --package cowsay node -e 'require("child_process").execSync("npx --yes create-vite@latest --help", { stdio: "inherit" })'
# sh: create-vite@latest: command not found (exit 127)

The same command with npm_config_package deleted from the child environment succeeds.

Suggested fix

Remove the npm exec-only keys inherited from an outer npm exec or npx (npm_config_package, and npm_config_call for npx -c) from envs before vp create spawns the package-manager runner. I am happy to open a pull request with a test in discovery.spec.ts if you want this approach.

System Info
macOS (Darwin 27.0.0)
Node.js 24.21.0
npm 11.19.0 (outer npx); vp installed npm 12.2.0 for the project
vite-plus 1.1.0 (main at c58f28c read for the source reference)
Used Package Manager

npm

Logs

See the output above. The exit code is 127. The outer npm debug log shows only that the parent command failed.

Lingua principale
Rust
Stelle
6k
Fork
274
Merge medio
1g 12h
PR unite (30g)
198

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 voidzero-dev/vite-plus

Tutte le issue di voidzero-dev/vite-plus

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.