Skip to content

fix: point bin entry to dist/cli/qmd.js for Windows compatibility#544

Open
kirmad wants to merge 1 commit intotobi:mainfrom
kirmad:fix/windows-bin-entry
Open

fix: point bin entry to dist/cli/qmd.js for Windows compatibility#544
kirmad wants to merge 1 commit intotobi:mainfrom
kirmad:fix/windows-bin-entry

Conversation

@kirmad
Copy link
Copy Markdown

@kirmad kirmad commented Apr 8, 2026

Problem

npm install -g @tobilu/qmd on Windows produces:

> qmd --help
Invalid executable path: C:\bin

npm generates .cmd and .ps1 wrappers for the bin entry. Because bin/qmd is a shell script, the wrappers try to invoke it via /bin/sh, which doesn't exist on Windows.

Fix

Point the bin entry in package.json to dist/cli/qmd.js instead of bin/qmd.

The build already prepends a #!/usr/bin/env node shebang to dist/cli/qmd.js, so npm creates proper cross-platform wrappers that invoke node directly. This is a one-line change.

bin/qmd is 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:

> qmd --help
qmd — Quick Markdown Search
...

> qmd status
QMD Status
...

> qmd collection add ~/Documents --name docs
✓ Collection 'docs' created successfully

> qmd search "test" -n 3
(results returned correctly)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants