-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npx/npm exec don't work in child workspace when using --no/--no-install and --package #3520
Comments
we've made a lot of changes to workspaces in the last several months, can you test this in npm 8.5.3 and let us know if it's fixed? |
I moved my original project to pnpm in the end, so I reproduced this problem by:
I still see the same output:
|
That repo really helps, thanks. Logs don't give much info
|
Yeah, the log output is no use at all. But I found it easy to step through with the debugger when I first encountered it - looks like the relevant code hasn't changed much since. |
Fixes the proper path location to use when targetting specific workspaces. Makes it so that libnpmexec is always reading from the Arborist actual tree instead of reading `node_modules` from the file system when retrieving local package data. Fixes: npm#3520 Relates to: npm#4619 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Makes it so that libnpmexec is always reading from the Arborist actual tree instead of reading `node_modules` from the file system when retrieving local package data. Fixes: npm#3520 Relates to: npm#4619 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Makes it so that libnpmexec is always reading from the Arborist actual tree instead of reading `node_modules` from the file system when retrieving local package data. Fixes: npm#3520 Relates to: npm#4619 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Makes it so that libnpmexec is always reading from the Arborist actual tree instead of reading `node_modules` from the file system when retrieving local package data. Fixes: npm#3520 Relates to: npm#4619 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Fixes: npm#3520 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Fixes: npm#3520 Relates to: npm/statusboard#403
Fixes the proper path location to use when targetting specific workspaces. Fixes: #3520 Relates to: npm/statusboard#403
Is there an existing issue for this?
Current Behavior
I am using NPM workspaces. I am running a command of the format:
It fails with a rather terse
npm ERR! canceled
.This is related to a previous issue #2826. The bug was partially resolved by @ruyadorno in npm/libnpmexec#2. However, looking at the commit, it seems that the fix was only applied inside the
if (needPackageCommandSwap)
block. This only executes if no--package
option has been specified.If
--package
is specified, then the code falls through to https://github.com/npm/libnpmexec/blob/a9423e441b914571ec18ad8a4496a3ecf2f500e2/lib/index.js#L153. It will then try to install the package (even though it's already available locally). However, if--no[-install]
is specified, it will simply throw an exception instead.Expected Behavior
The
npm exec
andnpx
commands should work when used in a workspace with the--package
and--no[-install]
options.Steps To Reproduce
No response
Environment
The text was updated successfully, but these errors were encountered: