Skip to content

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

@natashaannn

Description

@natashaannn

Environment

  • OS: Windows 10/11
  • nodejs-whisper: 0.2.9

Problem

Running npx nodejs-whisper download on Windows throws immediately:

  [Nodejs-whisper] Error: Downloader not found.

Root Cause

In dist/downloadModel.js (line 82), the downloader existence check always looks for the .sh
script:

if (!shelljs_1.default.which('./download-ggml-model.sh')) {
    throw '[Nodejs-whisper] Error: Downloader not found.\n';
}

shell.which() cannot resolve a .sh file on Windows, so this always throws before the build ever
starts.

Interestingly, the very next lines (87–88) already handle Windows correctly:

  let scriptPath = './download-ggml-model.sh';
  if (process.platform === 'win32')
      scriptPath = 'download-ggml-model.cmd';

The which() guard just wasn't updated to match.

Fix

Check for the platform-appropriate script, or skip the check on Windows since
download-ggml-model.cmd is always present in the package:

  const scriptToCheck = process.platform === 'win32'
      ? 'download-ggml-model.cmd'
      : './download-ggml-model.sh';

  if (!shelljs_1.default.which(scriptToCheck)) {
      throw '[Nodejs-whisper] Error: Downloader not found.\n';
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions