fix: point bin entry to dist/cli/qmd.js for Windows compatibility#544
Open
fix: point bin entry to dist/cli/qmd.js for Windows compatibility#544
Conversation
The bin entry pointed to bin/qmd, a shell script that requires /bin/sh.
On Windows, npm generates .cmd and .ps1 wrappers that try to invoke
/bin/sh, which does not exist, producing:
Invalid executable path: C:\bin
The build already prepends a #!/usr/bin/env node shebang to
dist/cli/qmd.js, so pointing the bin entry there lets npm create
proper cross-platform wrappers that invoke node directly.
bin/qmd is preserved for source-level development (npm link, bun
detection via lockfile heuristics) but is no longer the published
entry point.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm install -g @tobilu/qmdon Windows produces:npm generates
.cmdand.ps1wrappers for thebinentry. Becausebin/qmdis a shell script, the wrappers try to invoke it via/bin/sh, which doesn't exist on Windows.Fix
Point the
binentry inpackage.jsontodist/cli/qmd.jsinstead ofbin/qmd.The build already prepends a
#!/usr/bin/env nodeshebang todist/cli/qmd.js, so npm creates proper cross-platform wrappers that invokenodedirectly. This is a one-line change.bin/qmdis preserved in the repo for source-level development (npm link, bun/node detection via lockfile heuristics).Testing
Verified on Windows 11 with Node v24.8.0 / npm 11.6.0: