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';
}
Environment
Problem
Running
npx nodejs-whisper downloadon Windows throws immediately:Root Cause
In
dist/downloadModel.js(line 82), the downloader existence check always looks for the.shscript:
shell.which()cannot resolve a.shfile on Windows, so this always throws before the build everstarts.
Interestingly, the very next lines (87–88) already handle Windows correctly:
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: