cli
cli copied to clipboard
[BUG] `bundledDependencies` does not bundle relevant executables
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.