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

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

Geschlossen Anfängerfreundlich
#2,970 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Crimson341 arbeitet bereits daran.

Seit 11.10.2026.

  • #2993 von @Crimson341 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
70/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
nodejs, typescript
Bereich
cli, tooling

Rechercherichtung

Der Fehler liegt darin, wie vp create die Umgebung für den Template-Runner aufbaut: prependToPathToEnvs(..., { ...process.env }) in packages/cli/src/create/discovery.ts reicht npm_config_package an den verschachtelten Aufruf npx create-vite@latest weiter. Lies zuerst diese Funktion und reproduziere dann mit dem Befehl aus dem Issue oder dem execSync-Snippet. Fertig ist, wenn der npm-gewählte Lauf erfolgreich ist und die nur für npm exec relevanten Schlüssel aus der Umgebung des Child-Prozesses entfernt sind, mit einem Regressionstest in discovery.spec.ts.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
6.5k
Forks
296
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
224

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

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

Alle Issues in voidzero-dev/vite-plus

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

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