[BUG] Npx executes wrong version of dependency present in several workspaces #6276
Closed
2 tasks done
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 8.x
work is associated with a specific npm 8 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Suppose that you need a dependency (eg.
eslint
) in different versions in two workspaces (eg.childA
andchildB
):npx -w packages/childA
and in the interactive subshell executeeslint -v
. It returnsv8.36.0
as expectednpx -w packages/childB
and in the interactive subshell executeeslint -v
. It returnsv7.32.0
as expectednpx -w packages/childB eslint -v
. It returnsv8.36.0
(expectedv7.32.0
)Is this intended behaviour? Am I missing something when using
npx
in the context of workspaces?Expected Behavior
I expected
npx -w packages/childB eslint -v
to return theeslint
version relative to thechildB
workspace (ie.v7.32.0
).Steps To Reproduce
Using the following repo https://github.com/bertrandE/npm-repro-bin-child-workspace
Execute the commands specified in "Current Behavior".
Somewhat related issue: #2826
Environment
Tested on both NPM 8 and NPM 9.
The text was updated successfully, but these errors were encountered: