Skip to content

fix(pm): ignore an inherited npm_config_package in npm commands - #3578

Merged
fengmk2 merged 2 commits into
voidzero-dev:mainfrom
TheAlexLichter:fix/pm-dlx-inherited-npm-package
Nov 25, 2026
Merged

fengmk2 merged 2 commits into
voidzero-dev:mainfrom
TheAlexLichter:fix/pm-dlx-inherited-npm-package

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

npx --package=vite-plus vp ... exports npm_config_package=vite-plus.

With npm as the package manager, vp dlx <spec> then runs npm exec --yes -- <spec>, and npm reads the inherited package list: it installs vite-plus and runs <spec> as a command, failing with sh: <spec>: command not found.

vp migrate hits this in its ESLint step, which runs vp dlx @oxlint/migrate@<version>.

Set npm_config_package to an empty value for npm and npx commands, which npm 7 to 11 treat as no packages. npm 6's npx ignores the variable.

Refs #2970

`npx --package=vite-plus vp ...` exports `npm_config_package=vite-plus`.
With npm as the package manager, `vp dlx <spec>` then runs
`npm exec --yes -- <spec>`, and npm reads the inherited package list: it
installs `vite-plus` and runs `<spec>` as a command, failing with
`sh: <spec>: command not found`. `vp migrate` hits this in its ESLint step,
which runs `vp dlx @oxlint/migrate@<version>`.

Set `npm_config_package` to an empty value for npm and npx commands, which
npm 7 to 11 treat as no packages. npm 6's npx ignores the variable.

Refs voidzero-dev#2970
@fengmk2 fengmk2 self-assigned this Nov 25, 2026
@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels Nov 25, 2026
@fengmk2
fengmk2 merged commit 7ac8b66 into voidzero-dev:main Nov 25, 2026
149 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants