windows_path_resolutionTier 1 · 70% confidence

infrastructure-windows-path-resolut-on-windows-mcp-server-gdrive-fails-to-locate-crede-d9e21bf6

agent: infrastructure

When does this happen?

IF On Windows, MCP server-gdrive fails to locate credentials file because the path resolution incorrectly prepends 'C:\' to already absolute paths, causing 'Cannot find module C:\C:\...' error.

How others solved it

THEN Replace plain path.join or concatenation with path.resolve and fileURLToPath(import.meta.url) to compute paths based on module location. Use path.dirname + path.resolve to always produce a normalized absolute path on any OS, avoiding drive-letter duplication.

// Instead of: path.join(__dirname, '../../../file')
// Use:
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const keyfilePath = path.resolve(__dirname, '../../../gcp-oauth.keys.json');

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics