Skip to content

Conversation

@EstoesMoises
Copy link

@EstoesMoises EstoesMoises commented Dec 14, 2025

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.

@github-actions github-actions bot added docs-infra python For content related to the Python version of LangChain projects external User is not a member of langchain-ai labels Dec 14, 2025
Copilot AI review requested due to automatic review settings December 15, 2025 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a Windows compatibility issue where the docs dev command fails with a FileNotFoundError when trying to start the Mintlify development server. The fix adds platform-specific subprocess creation logic: on Windows, it uses create_subprocess_shell to handle .CMD batch files, while on Unix systems, it continues to use create_subprocess_exec.

Key changes:

  • Added platform detection using sys.platform == "win32"
  • Implemented conditional subprocess creation based on operating system
  • Changed the command name from "mint" to "mintlify" in both code paths

@lnhsingh lnhsingh self-requested a review December 15, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-infra external User is not a member of langchain-ai python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants