Skip to content

fix: prefer native command names outside Windows in render_demo - #552

Merged
calesthio merged 1 commit into
OpenMontageInc:mainfrom
ThinkUP-Vers:fix/npx-resolution-wsl
Nov 8, 2026
Merged

calesthio merged 1 commit into
OpenMontageInc:mainfrom
ThinkUP-Vers:fix/npx-resolution-wsl

Conversation

@ThinkUP-Vers

Copy link
Copy Markdown
Contributor

Problem

find_command tries Windows-only names first ("npx.cmd", "npm.cmd"). Under WSL, the Windows binaries exposed through /mnt/c PATH interop win over the Linux ones, and Python then fails to exec a batch file:

OSError: [Errno 8] Exec format error: '/mnt/c/Program Files/nodejs/npx.cmd'

This breaks make demo for every WSL user — which is notable, since WSL is a common path for Windows users who lack make.

Fix

Filter .cmd/.exe candidates when not on Windows. This matches the platform check already used in tools/video/remotion_caption_burn.py:329, so it follows an existing convention rather than introducing a new one. Windows behaviour is unchanged. One change point fixes node, npm and npx together.

Testing

Ubuntu 26.04 under WSL2, Node v22.22.1, Python 3.14.4. Before: fails at npx resolution. After: npx -> /usr/bin/npx, npm -> /usr/bin/npm, and render_demo.py renders all three demos (1920x1080, 30 fps) with the Windows PATH intact and no workaround.

🤖 Generated with Claude Code

`find_command` tried Windows-only names first ("npx.cmd", "npm.cmd"),
so under WSL the Windows binaries exposed through /mnt/c PATH interop
won over the Linux ones. Python then failed to exec a batch file:

    OSError: [Errno 8] Exec format error: '/mnt/c/Program Files/nodejs/npx.cmd'

This broke `make demo` for every WSL user — the very workaround the
README recommends to Windows users who lack `make`.

Filter .cmd/.exe candidates off Windows, matching the platform check
already used in tools/video/remotion_caption_burn.py:329. Windows
behaviour is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@calesthio calesthio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the WSL command-resolution fix. The two-line filter cleanly integrates with current main and matches the existing native-platform convention. An independent mocked-PATH regression passed for Linux, macOS and Windows: non-Windows selects native npx without trying .cmd/.exe; Windows retains the original candidate order. I reviewed the full render_demo command-discovery call sites. No demo dependencies were installed or media rendered.

@calesthio calesthio closed this Nov 7, 2026
@calesthio calesthio reopened this Nov 7, 2026
calesthio pushed a commit that referenced this pull request Nov 8, 2026
@calesthio
calesthio merged commit 91bee52 into OpenMontageInc:main Nov 8, 2026
1 check 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.

2 participants