`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
Research direction
The bug is in how vp create builds the environment for the template runner: prependToPathToEnvs(..., { ...process.env }) in packages/cli/src/create/discovery.ts passes npm_config_package through to the nested npx create-vite@latest call. Start by reading that function, then reproduce with the command in the issue or the execSync snippet. Done means the npm-selected run succeeds and the npm exec-only keys are dropped from the child environment, with a regression test in discovery.spec.ts.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 6k
- Forks
- 274
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 198
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from voidzero-dev/vite-plus
-
PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` failsPossibly taken @fengmk2 claimed this 2 days ago. Openbug pending triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
voidzero-dev/vite-plus#2934 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Skip the `vpr` hint when the script runs the same built-inPossibly taken @kshanxs claimed this 1 day ago. Openpending triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
voidzero-dev/vite-plus#2892 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
voidzero-dev/vite-plus#2882 · 2 comments ·
Maintainers usually reply within 1 day
-
`lazyPlugins` docs: dynamic import of a local module still slows down config loadingPossibly taken @kshanxs claimed this 1 day ago. Opendocumentation pending triage
Difficulty 1/5 Under an hour Newbie friendliness 78/100
voidzero-dev/vite-plus#2875 · 4 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
voidzero-dev/vite-plus#2097 · 10 comments · 2 reactions ·
Maintainers usually reply within 1 day
All issues in voidzero-dev/vite-plus
Similar issues
-
bug user-priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rescript-lang/rescript#8765 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nautechsystems/nautilus_trader#5287 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
farion1231/cc-switch#8072 ·
Maintainers usually reply within 1 day
-
Python 3.15 supportPossibly taken @amnesiaof claimed this today. OpenL: python L: python:uv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16524 · 1 comment ·
Maintainers usually reply within 1 day