Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

[BUG] Unexpected binary invoked #77

Open
medikoo opened this issue Aug 25, 2020 · 2 comments
Open

[BUG] Unexpected binary invoked #77

medikoo opened this issue Aug 25, 2020 · 2 comments

Comments

@medikoo
Copy link

medikoo commented Aug 25, 2020

Current Behavior

I've run following in context of some local package:

npx github-release-from-cc-changelog v2.34.7

With github-release-from-cc-changelog neither being available locally or globally

Instead of github-release-from-cc-changelog binary npx invokes dump-release-notes-from-cc-changelog binary

Expected Behavior

It's github-release-from-cc-changelog binary that should be invoked


I'm using npx as bundled with npm v6.14.7 (not exactly sure which version of npm is that, as npx -v outputs npm verison)

$ npx -v
6.14.7
@ljharb
Copy link

ljharb commented Aug 25, 2020

npx takes a package name, not a bin name, and selects the first bin listed. I don't think there's any way to use npx to invoke alternative binaries in a package.

One workaround might be to create a fourth binary that can dispatch to the other three, and put that first? (or even, to make that the primary interface for the package and only provide one binary)

@medikoo
Copy link
Author

medikoo commented Aug 25, 2020

npx takes a package name ... and selects the first bin listed

Would there be any implications in improving the logic, so it's a binary which matches the package name that is picked (only if it's found, otherwise it could be first in a list, as it happens now)

medikoo added a commit to serverless/components that referenced this issue Aug 25, 2020
medikoo added a commit to serverless/components that referenced this issue Aug 25, 2020
medikoo added a commit to serverless/components that referenced this issue Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants