Environment
- OS: Windows 11
- Shell: PowerShell / cmd.exe
- Node.js: v24.14.1
- optimo: 0.0.27
- ffmpeg: 8.1 (installed via Scoop)
Description
optimo always reports [skipped] with the message ffmpeg: Run brew install ffmpeg to fix it on Windows, even when ffmpeg is correctly installed and available in PATH.
Root cause
src/util/resolve-binary.js uses which to detect binaries:
execSync(`which ${binary}`, { stdio: ['pipe', 'pipe', 'ignore'] })
which is a Unix command and does not exist on Windows natively. This causes execSync to throw, resolve-binary returns false, and the file is silently skipped.
Note: running optimo from Git Bash returns [unsupported] instead of [skipped], because Git Bash ships its own which. This difference in behavior is what helped narrow down the root cause.
Workaround
Installing which via Scoop (scoop install which) fixes the issue immediately.
Suggested fix
Fall back to where.exe on Windows:
const { execSync } = require('node:child_process')
const isWindows = process.platform === 'win32'
module.exports = binary => {
try {
const cmd = isWindows ? `where.exe ${binary}` : `which ${binary}`
return execSync(cmd, { stdio: ['pipe', 'pipe', 'ignore'] })
.toString()
.trim()
.split('\n')[0] // where.exe may return multiple lines
} catch {
return false
}
}
Alternatively, packages like which (npm) handle cross-platform binary resolution out of the box.
Environment
Description
optimoalways reports[skipped]with the messageffmpeg: Run brew install ffmpeg to fix iton Windows, even when ffmpeg is correctly installed and available in PATH.Root cause
src/util/resolve-binary.jsuseswhichto detect binaries:whichis a Unix command and does not exist on Windows natively. This causesexecSyncto throw,resolve-binaryreturnsfalse, and the file is silently skipped.Note: running optimo from Git Bash returns
[unsupported]instead of[skipped], because Git Bash ships its ownwhich. This difference in behavior is what helped narrow down the root cause.Workaround
Installing
whichvia Scoop (scoop install which) fixes the issue immediately.Suggested fix
Fall back to
where.exeon Windows:Alternatively, packages like
which(npm) handle cross-platform binary resolution out of the box.