[PR #1902] [MERGED] fix(dev): add Windows compatibility for mintlify subprocess #1955

Closed
opened 2026-02-17 17:22:54 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1902
Author: @EstoesMoises
Created: 12/14/2025
Status: Merged
Merged: 12/19/2025
Merged by: @lnhsingh

Base: mainHead: fix/windows-mintlify-compatibility


📝 Commits (4)

  • 7a0d180 fix(dev): add Windows compatibility for mintlify subprocess
  • eb05b6a Merge branch 'main' into fix/windows-mintlify-compatibility
  • 7b1ec19 fix: reverting change from mintlify to mint command
  • 812c732 Merge branch 'fix/windows-mintlify-compatibility' of https://github.com/EstoesMoises/docs into fix/windows-mintlify-compatibility

📊 Changes

1 file changed (+21 additions, -9 deletions)

View changed files

📝 pipeline/commands/dev.py (+21 -9)

📄 Description

Overview

Fixes Windows compatibility issue where the docs dev command fails with FileNotFoundError when attempting to start the Mintlify development server. The issue occurs because Windows npm packages are installed as .CMD files which cannot be executed directly by asyncio.create_subprocess_exec.

Type of change

Type: Fix bug

Additional notes

Problem:
When I was trying to run my local dev environment on Windows 11, the docs dev command failed with:

FileNotFoundError: [WinError 2] The system cannot find the file specified

After digging into the issue, I discovered that the script was attempting to run Mintlify as if it were a regular shell executable. On Windows, however, npm installs global packages like Mintlify as .CMD batch files rather than native executables. Because of this, asyncio.create_subprocess_exec cannot directly execute .cmd batch files on Windows because they require a shell (cmd.exe) to interpret them.

To address this, the solution was to adjust how subprocesses are created based on the operating system. On Windows, create_subprocess_shell is used so the shell can properly interpret and run the .CMD file. On Unix-based systems (Linux and macOS), create_subprocess_exec is still used, since there is no need for invoking a shell. Platform detection is handled via sys.platform == "win32", which ensures the behavior is correct and consistent across environments.

The fix works for my machine running Windows 11 using Python 3.13 and Git Bash (MINGW64). The Mintlify development server starts successfully, file watching and hot reloading work as expected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1902 **Author:** [@EstoesMoises](https://github.com/EstoesMoises) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@lnhsingh](https://github.com/lnhsingh) **Base:** `main` ← **Head:** `fix/windows-mintlify-compatibility` --- ### 📝 Commits (4) - [`7a0d180`](https://github.com/langchain-ai/docs/commit/7a0d180a0825c8fd3ec3dc65c38e839e3102a3d2) fix(dev): add Windows compatibility for mintlify subprocess - [`eb05b6a`](https://github.com/langchain-ai/docs/commit/eb05b6a845f8ea3343ee6756686f216287beb2ec) Merge branch 'main' into fix/windows-mintlify-compatibility - [`7b1ec19`](https://github.com/langchain-ai/docs/commit/7b1ec19933377172d516313f34be6a6f1ef1e7ec) fix: reverting change from mintlify to mint command - [`812c732`](https://github.com/langchain-ai/docs/commit/812c732ef47faf310a9d9e0b8f7d70b5ae09a5e5) Merge branch 'fix/windows-mintlify-compatibility' of https://github.com/EstoesMoises/docs into fix/windows-mintlify-compatibility ### 📊 Changes **1 file changed** (+21 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `pipeline/commands/dev.py` (+21 -9) </details> ### 📄 Description ## Overview Fixes Windows compatibility issue where the `docs dev` command fails with `FileNotFoundError` when attempting to start the Mintlify development server. The issue occurs because Windows npm packages are installed as `.CMD` files which cannot be executed directly by `asyncio.create_subprocess_exec`. ## Type of change **Type:** Fix bug ## Additional notes **Problem:** When I was trying to run my local dev environment on Windows 11, the `docs dev` command failed with: ``` FileNotFoundError: [WinError 2] The system cannot find the file specified ``` After digging into the issue, I discovered that the script was attempting to run Mintlify as if it were a regular shell executable. On Windows, however, npm installs global packages like Mintlify as `.CMD` batch files rather than native executables. Because of this, `asyncio.create_subprocess_exec` cannot directly execute .cmd batch files on Windows because they require a shell (cmd.exe) to interpret them. To address this, the solution was to adjust how subprocesses are created based on the operating system. On Windows, `create_subprocess_shell` is used so the shell can properly interpret and run the `.CMD` file. On Unix-based systems (Linux and macOS), `create_subprocess_exec` is still used, since there is no need for invoking a shell. Platform detection is handled via `sys.platform == "win32"`, which ensures the behavior is correct and consistent across environments. The fix works for my machine running Windows 11 using Python 3.13 and Git Bash (MINGW64). The Mintlify development server starts successfully, file watching and hot reloading work as expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:54 -05:00
yindo closed this issue 2026-02-17 17:22:54 -05:00
yindo changed title from [PR #1902] fix(dev): add Windows compatibility for mintlify subprocess to [PR #1902] [MERGED] fix(dev): add Windows compatibility for mintlify subprocess 2026-06-05 18:15:51 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1955