-
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] npm does not setup child workspace’s bin or use parent’s bin #4591
Comments
I encounter the same issue. as a workaround, i need to:
and I observe that in the second
this is really annoying for us, hope this could be prioritize and fixed soon. |
Ran into this as well. Running the following caused an error. npm ci
npx lerna run build
npx <workspace-name> The solution I found was to add an npm ci
npx lerna run build
npm update <workspace-name>
npx <workspace-name> That seems to work for me, without having to run a full "install" again. |
I believe I'm running into a related issue here. I've got two git repos: Inside of
When I try to install within But when installing |
What I've done was instead
This way, straight after installing modules, my
This way after whole |
@jlarmstrongiv can you try replicating this problem on the latest version of ~/workarea/rep $ npm ls
[email protected] /Users/milaninfy/workarea/rep
├─┬ [email protected] -> ./w1
│ └── [email protected] deduped -> ./w2
└── [email protected] -> ./w2
# my setup for workspaces
~/workarea/rep $ npm pkg get workspaces
[
"w1",
"w2"
]
# w2 has bin specified
~/workarea/rep $ npm pkg get bin -w w2
{
"w2": "index.js"
}
# w1 has script using w2 bin
~/workarea/rep $ npm pkg get scripts -w w1
{
"w1": {
"test": "npx w2"
}
}
# running script in w1
~/workarea/rep/w1 $ npm run test
> [email protected] test
> npx w2
Hello, world!
# running script in root with workspace flag
~/workarea/rep $ npm run test -w w1
> [email protected] test
> npx w2
Hello, world! |
Closing due to age. If this is still a problem please feel free to reopen this issue, or create a new issue w/ steps to reproduce. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I cannot run unpublished npx package scripts in child workspaces
Expected Behavior
When using npm, whether from:
I expect to find the
node_modules/.bin
folder for mypackage.json
scripts in the child workspaces, not just parent. I expect npm to link the bin folder in my child package.Or, I expect npm to fallback to/include the parent’s bin, so that unpublished npx commands can still be found.
Steps To Reproduce
npm install
npm run port
Other notes:
These script work fine in the parent package.json, as the
node_modules/.bin
folder exists. However, it will crash in all child workspaces by trying to find a published version on npm.Other notes:
Related issues:
Environment
The text was updated successfully, but these errors were encountered: