Skip to content

fix(create): don't leak npx --package env into nested npx (#2970) - #2993

Open
Crimson341 wants to merge 1 commit into
voidzero-dev:mainfrom
Crimson341:fix/create-npx-inherited-env
Open

Crimson341 wants to merge 1 commit into
voidzero-dev:mainfrom
Crimson341:fix/create-npx-inherited-env

Conversation

@Crimson341

Copy link
Copy Markdown

Fixes #2970.

npx --package=vite-plus vp create sets npm_config_package / npm_config_call, which leaked into the nested npx create-vite and broke it on npm. This strips them at the start of vp create.

Added unit tests and a snapshot case (create_npm_inherited_npx_env).

…ev#2970)

`npx --package=vite-plus vp create` exports `npm_config_package` and
`npm_config_call` to `vp`. `vp create` forwarded its whole environment to
the template runner, so the nested `npx create-vite@latest` on npm re-ran
vite-plus instead and failed with EUSAGE / "command not found".

Strip both variables from `process.env` at the start of `vp create`, which
also covers children spawned from Rust with the real process env, and from
the env built by `discoverTemplate`.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant