Skip to content

fix(dlx): respect npm's yes setting instead of forcing --yes - #3530

Closed
jong-kyung wants to merge 3 commits into
voidzero-dev:mainfrom
jong-kyung:fix/dlx-respect-npm-yes
Closed

jong-kyung wants to merge 3 commits into
voidzero-dev:mainfrom
jong-kyung:fix/dlx-respect-npm-yes

Conversation

@jong-kyung

Copy link
Copy Markdown
Collaborator

Right now, vp dlx always passes --yes to npm exec on npm 7 and later, and to the npx fallback for Yarn 1. Because a CLI flag takes precedence over every other npm config source, this overrides npm_config_yes=false and yes=false in .npmrc. Since #3478, vp create runs remote templates through vp dlx, so a template that npm would previously refuse to install now installs and runs. Related discussion

This PR omits --yes when the npm config explicitly sets yes, so npm applies the user's choice. Before resolving a dlx command, dispatch reads the npm_config_* environment variables and the project and user .npmrc files through the existing NpmConfig loader. When the setting is absent, vp dlx keeps passing --yes, so the default behavior stays prompt-free like pnpm dlx and yarn dlx. npm 6 npx never received --yes, so it is unchanged.

The global npmrc is only read when globalconfig selects it explicitly, because the default global path requires running npm.

`vp dlx` passed `--yes` to `npm exec` and to the Yarn 1 `npx` fallback,
which overrode `npm_config_yes=false` and `yes=false` in `.npmrc`. When
npm config sets `yes`, `vp dlx` now omits `--yes` so npm applies the
user's install confirmation choice.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@jong-kyung jong-kyung self-assigned this Nov 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T15:39:13.598843Z a2f5bd4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Nov 21, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 807ae2ee4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
jong-kyung marked this pull request as ready for review November 21, 2026 15:34
@jong-kyung
jong-kyung requested a review from fengmk2 November 21, 2026 15:35
) -> Result<DispatchResult, Error> {
if let PackageManagerCommand::Dlx(args) = &mut command {
// Keep the user's npm install confirmation choice instead of overriding it with `--yes`.
args.npm_yes_configured = NpmConfig::load_for_cwd(cwd).values.contains_key("yes");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. I agree that someone who sets yes=false would expect vp dlx to respect it. I’d expect that case to be fairly uncommon, though, and this change adds a config lookup to every dlx run, even with pnpm or Bun. Given that trade-off, I’d prefer to keep the current behavior for now.

@jong-kyung jong-kyung closed this Nov 22, 2026
@jong-kyung
jong-kyung deleted the fix/dlx-respect-npm-yes branch November 22, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants