`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager
Maintainer antworten meist innerhalb von 1 Tag
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
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
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
vpruns it, with no outernpx; pnpm dlx --package vite-plus vp createruns it;- pnpm, Yarn, or Bun is the selected package manager;
npm_config_packageis removed from the environment beforevpstarts.
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
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- 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 voidzero-dev/vite-plus
-
pending triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
voidzero-dev/vite-plus#3235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docker guide: the runtime stage needs libatomic1 for Node.js 25 and laterEvtl. vergeben @kshanxs hat das vor 3 Tagen übernommen. Offendocumentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
voidzero-dev/vite-plus#3219 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
pending triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
voidzero-dev/vite-plus#2882 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 53/100
voidzero-dev/vite-plus#3254 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Operate environment tools only when global-cli is installed with managed mode enabled in `vite-plus` packageEvtl. vergeben @liangmiQwQ hat das heute übernommen. Offenbug enhancement
voidzero-dev/vite-plus#3252 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/vite-plus
Ähnliche Issues
-
area:io kernel-paused needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bherbruck/solvecraft#7854 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
transit-audio/transit#159 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
HakanSeven12/OpenCADStudio#2257 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority: low ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
storytold/photocraft#9884 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage: new type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Jagalite/superseedr#376 ·
Maintainer antworten meist innerhalb von 1 Tag