Skip to content

[Fix]installer failure on Windows with spaces in path#940

Merged
4pmtong merged 4 commits intoeigent-ai:mainfrom
sashimikun:fix/windows-path-spaces-6492068818485962319
Jan 19, 2026
Merged

[Fix]installer failure on Windows with spaces in path#940
4pmtong merged 4 commits intoeigent-ai:mainfrom
sashimikun:fix/windows-path-spaces-6492068818485962319

Conversation

@sashimikun
Copy link
Copy Markdown
Contributor

@sashimikun sashimikun commented Jan 18, 2026

Description

This PR fixes a bug where the installer fails on Windows machines when the user profile path contains spaces (e.g., C:\Users\John Doe). The issue was caused by the uv executable path not being quoted when executing npm and npx commands with shell: true. Without quotes, the shell interprets the space as an argument separator. This change adds quotes around the uv path to ensure it is treated as a single argument. Additionally, it includes a fix for the test mocks to ensure unit tests pass.

Address Issue: #891

Verification:

  • Created a reproduction script using spawn with shell: true and a path with spaces, confirming that quoting fixes the issue.
  • Ran the unit tests (test/unit/electron/install-deps.test.ts) and they all pass.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

The `uv` executable path was not quoted, causing failures on Windows when the user profile path contained spaces (e.g. "C:\Users\John Doe\.eigent\bin\uv.exe"). This occurs because `spawn` with `shell: true` parses the space as an argument separator.

This change wraps the `uv_path` in double quotes when constructing `npmCommand` and `npxCommand`, ensuring the shell treats the full path as the executable.

Also fixed a missing mock for `getUvEnv` in `test/mocks/environmentMocks.ts` which was causing unit tests to fail.
The `uv` executable path was not quoted, causing failures on Windows when the user profile path contained spaces (e.g. "C:\Users\John Doe\.eigent\bin\uv.exe"). This occurs because `spawn` with `shell: true` parses the space as an argument separator.

This change wraps the `uv_path` in double quotes when constructing `npmCommand` and `npxCommand`, ensuring the shell treats the full path as the executable.

Also fixed a missing mock for `getUvEnv` in `test/mocks/environmentMocks.ts` which was causing unit tests to fail.
The `uv` executable path was not quoted, causing failures on Windows when the user profile path contained spaces (e.g. "C:\Users\John Doe\.eigent\bin\uv.exe"). This occurs because `spawn` with `shell: true` parses the space as an argument separator.

This change wraps the `uv_path` in double quotes when constructing `npmCommand` and `npxCommand`, ensuring the shell treats the full path as the executable.

Also fixed a missing mock for `getUvEnv` in `test/mocks/environmentMocks.ts` which was causing unit tests to fail.
@Wendong-Fan
Copy link
Copy Markdown
Contributor

thanks @sashimikun for the contribution! could @4pmtong @LuoPengcheng12138 help checking this?

Copy link
Copy Markdown
Contributor

@LuoPengcheng12138 LuoPengcheng12138 left a comment

Choose a reason for hiding this comment

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

LGTM!

@4pmtong 4pmtong merged commit f852297 into eigent-ai:main Jan 19, 2026
5 checks passed
@fengju0213 fengju0213 linked an issue Jan 19, 2026 that may be closed by this pull request
@fengju0213 fengju0213 mentioned this pull request Jan 19, 2026
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.

[BUG]

4 participants