Repository navigation
fix(dlx): respect npm's yes setting instead of forcing --yes - #3530
jong-kyung wants to merge 3 commits into
Conversation
`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.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
| ) -> 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"); |
There was a problem hiding this comment.
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.
Right now,
vp dlxalways passes--yestonpm execon npm 7 and later, and to thenpxfallback for Yarn 1. Because a CLI flag takes precedence over every other npm config source, this overridesnpm_config_yes=falseandyes=falsein.npmrc. Since #3478,vp createruns remote templates throughvp dlx, so a template that npm would previously refuse to install now installs and runs. Related discussionThis PR omits
--yeswhen the npm config explicitly setsyes, so npm applies the user's choice. Before resolving adlxcommand, dispatch reads thenpm_config_*environment variables and the project and user.npmrcfiles through the existingNpmConfigloader. When the setting is absent,vp dlxkeeps passing--yes, so the default behavior stays prompt-free likepnpm dlxandyarn dlx. npm 6npxnever received--yes, so it is unchanged.The global
npmrcis only read whenglobalconfigselects it explicitly, because the default global path requires running npm.