Skip to content

bug for window install #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Iwantnew-bot opened this issue Mar 15, 2025 · 0 comments · Fixed by #13
Closed

bug for window install #8

Iwantnew-bot opened this issue Mar 15, 2025 · 0 comments · Fixed by #13

Comments

@Iwantnew-bot
Copy link

Title

ESM Loader Error on Windows: Invalid path protocol 'c:' when running setup command

Environment

  • OS: Windows11
  • Node.js version: 11.2.0
  • Package version: @wonderwhy-er/desktop-commander

Steps to Reproduce

  1. Install the package: npm install @wonderwhy-er/desktop-commander
  2. Run the setup command: npx @wonderwhy-er/desktop-commander setup

Error Message

npx @wonderwhy-er/desktop-commander setup
{"type":"error","timestamp":"2025-03-15T03:02:31.900Z","message":"Failed to start server: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'"}

Expected Behavior

The setup command should complete successfully without any ESM path resolution errors.

Analysis

This error occurs because of how Node.js ESM (ECMAScript Module) system handles paths on Windows. The error indicates that:

  1. The ESM loader is attempting to use a Windows-style absolute path (starting with c:) directly as a URL protocol
  2. The ESM loader only supports specific URL schemes: file://, data:, and node:
  3. On Windows, absolute paths must be properly formatted as file:// URLs to work with the ESM loader

It seems the package is not correctly converting Windows-style paths to the proper file:// URL format required by Node.js ESM when running on Windows systems.

Possible Solutions

Some potential fixes that the maintainers might consider:

  1. Update the path resolution code to properly convert Windows paths to valid file:// URLs
  2. Use the url.pathToFileURL() Node.js API to convert file paths to proper URLs
  3. Ensure compatibility with the ESM loader requirements across all operating systems

Additional Information

This appears to be a Windows-specific issue, as the Windows path format (using colons and backslashes) is incompatible with URL specifications unless properly converted.

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 a pull request may close this issue.

1 participant