Windows build fails with "WinError 193" when js_language = 'typescript'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 290
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
Building documentation with sphinx-js on Windows fails with an OSError: [WinError 193] %1 is not a valid Win32 application error when js_language = 'typescript' is set in conf.py. The build proceeds without error when js_language is left at its default or explicitly set to 'javascript'. This indicates an issue with how sphinx-js invokes the Node.js subprocess with TypeDoc on Windows.
Steps to Reproduce
- Environment:
- OS: Windows 10/11 (x64)
- Python: 3.x (x64)
- Node.js: 18+ (x64)
sphinx-js: Latest version frompiptypedoc: Latest version fromnpm
conf.pysetup:# ... other configurations extensions = [ "sphinx_js", # ... other extensions ] js_source_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")) js_language = 'typescript' jsdoc_config_path = "../typedoc.json" # Optional, but tried explicitly to confirm: js_node_executable = r"C:\Program Files\nodejs\node.exe"- Command: Run
make clean && make htmlfrom thedocsdirectory. - Observe: The build fails with the
WinError 193exception.
Expected Behavior
The documentation should build successfully for TypeScript source files, similar to how it builds for JavaScript. The Node.js subprocess should be invoked correctly by sphinx-js.
Actual Behavior
The build process is terminated with an OSError: [WinError 193], indicating that the subprocess call to Node.js was invalid.
Additional Information
- This error is consistent even after ensuring both Python and Node.js are 64-bit and hardcoding the
node.exepath inconf.py. - Running
where nodeon the affected system showed bothC:\Program Files\nodejs\node.exeandC:\Users\<user>\AppData\Local\Microsoft\WindowsApps\node.cmd. Disabling the WindowsApps alias did not resolve the issue, suggesting a deeper conflict in the subprocess invocation. - The same setup works without issue on a Linux system, confirming the problem is specific to the Windows implementation of
sphinx-js's TypeDoc subprocess handling. - Disabling
js_language = 'typescript'and relying on the JavaScript build works, indicating the core issue is limited to the TypeScript-specific codepath.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the conf.py settings and reproduce the failure using make clean && make html on Windows with js_language = 'typescript'. Trace the TypeDoc subprocess invocation in the TypeScript-specific codepath, comparing it with the JavaScript path; done means the documentation build succeeds on Windows with the configured node.exe path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, python, typescript
- Domain
- build-system, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100