[BUG] `bundledDependencies` does not bundle relevant executables
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Current Behavior:
Bundled dependencies do not export executables when packing.
Expected Behavior:
npm pack output should include scripts under .bin to launch any executables provided by the bundled depdency.
Steps To Reproduce:
- Install any dependency that exposes an executable, e.g.
lws. - Include this dependency in
bundledDependencies npm pack- The resulting artifact includes the
bundledDependencyundernode_modules, but does not create a.bindirectory at all, and so the depdency's executable(s) will not be available.
Environment:
- WIn10 20H2
- Node: 14.15.4
- npm: 6.14.10
Notes
I see from https://github.com/npm/cli/issues/1689 that bundledDependencies does not currently do special handling of the dep's package.json, such as looking at the files field. It's probably impractical / undesirable to process the whole bin field from package.json during pack, but at least it would make sense to check the existing node_modules/.bin for scripts that exactly match the package name and include those in the output.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with npm pack, then inspect package.json, node_modules/.bin, and the packed artifact. Compare the behavior with the special handling discussed in issue 1689. Done means a bundled dependency's matching executable is available under .bin in the npm pack output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100