You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Install the package: npm install @wonderwhy-er/desktop-commander
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:
The ESM loader is attempting to use a Windows-style absolute path (starting with c:) directly as a URL protocol
The ESM loader only supports specific URL schemes: file://, data:, and node:
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:
Update the path resolution code to properly convert Windows paths to valid file:// URLs
Use the url.pathToFileURL() Node.js API to convert file paths to proper URLs
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.
The text was updated successfully, but these errors were encountered:
Title
ESM Loader Error on Windows: Invalid path protocol 'c:' when running setup command
Environment
Steps to Reproduce
npm install @wonderwhy-er/desktop-commander
npx @wonderwhy-er/desktop-commander setup
Error Message
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:
c:
) directly as a URL protocolfile://
,data:
, andnode:
file://
URLs to work with the ESM loaderIt 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:
file://
URLsurl.pathToFileURL()
Node.js API to convert file paths to proper URLsAdditional 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.
The text was updated successfully, but these errors were encountered: