Skip to content

fix: use platform-appropriate script path in downloader check on Windows#243

Merged
ChetanXpro merged 1 commit intoChetanXpro:mainfrom
natashaannn:fix/windows-downloader-check
Apr 11, 2026
Merged

fix: use platform-appropriate script path in downloader check on Windows#243
ChetanXpro merged 1 commit intoChetanXpro:mainfrom
natashaannn:fix/windows-downloader-check

Conversation

@natashaannn
Copy link
Copy Markdown
Contributor

Fixes #242

How to test

On Windows

  1. Clone the repo and run npm install
  2. Run npx nodejs-whisper download before this fix (checkout main)
    • Expected: immediately throws [Nodejs-whisper] Error: Downloader not found.
  3. Apply the fix (checkout this branch)
  4. Run npx nodejs-whisper download again
    • Expected: model selection prompt appears, download proceeds, cmake build runs

Simulating the bug on any platform

The which() check can be tested in isolation:

const shell = require('shelljs')

// Simulates what the old code does on Windows
console.log(shell.which('./download-ggml-model.sh')) // null on Windows

// Simulates what the fix does on Windows
console.log(shell.which('download-ggml-model.cmd'))  // returns path on Windows

Run this inside cpp/whisper.cpp/models/ where the scripts live.

Unit-level check (any platform)

You can also force the Windows branch by temporarily hardcoding process.platform === 'win32' to true in the fixed code and confirming which() resolves download-ggml-model.cmd correctly.

Note

I later hit a libgomp-1.dll crash you hit as a downstream consequence of this bug: because the download/build never ran, an old MinGW-linked binary was sitting there from a prior partial build attempt. The real first failure was this which() check. Looking to fix this bug first before filing the libgomp one as a separate issue + PR after this one merges.

Replace faulty `if (!shell.which('./download-ggml-model.sh')) {
      throw '[Nodejs-whisper] Error: Downloader not found.\n'
  }` downloader check script on Windows.

Fixes ChetanXpro#242
Copy link
Copy Markdown
Owner

@ChetanXpro ChetanXpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ChetanXpro ChetanXpro merged commit c028950 into ChetanXpro:main Apr 11, 2026
0 of 4 checks passed
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.

Bug: [Windows] "Downloader not found" error — which() check uses .sh path on all platforms

2 participants