`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager
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
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
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.
- Lingua principale
- Rust
- Stelle
- 6k
- Fork
- 274
- Merge medio
- 1g 12h
- PR unite (30g)
- 198
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di voidzero-dev/vite-plus
-
PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` failsForse già presa @fengmk2 l’ha presa 2 giorni fa. Apertabug pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/vite-plus#2934 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Skip the `vpr` hint when the script runs the same built-inForse già presa @kshanxs l’ha presa 1 giorno fa. Apertapending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
voidzero-dev/vite-plus#2892 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/vite-plus#2882 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`lazyPlugins` docs: dynamic import of a local module still slows down config loadingForse già presa @kshanxs l’ha presa 1 giorno fa. Apertadocumentation pending triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
voidzero-dev/vite-plus#2875 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
voidzero-dev/vite-plus#2097 · 10 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di voidzero-dev/vite-plus
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
objectionary/sodg.rs#301 ·
-
[Bug] Completion info popup (.cm-completionInfo) ignores the configured editor fontForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rescript-lang/rescript#8765 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nautechsystems/nautilus_trader#5287 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
farion1231/cc-switch#8072 ·
I maintainer di solito rispondono entro 1 giorno