Repository navigation
fix(create): don't leak npx --package env into nested npx (#2970) - #2993
Open
Crimson341 wants to merge 1 commit into
Open
Crimson341 wants to merge 1 commit into
Crimson341 wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2970.
npx --package=vite-plus vp createsetsnpm_config_package/npm_config_call, which leaked into the nestednpx create-viteand broke it on npm. This strips them at the start ofvp create.Added unit tests and a snapshot case (
create_npm_inherited_npx_env).