Skip to content

Win10 pnpm debug error #3

@Jacobinwwey

Description

@Jacobinwwey

PS E:\mcp\google-search> pnpm --version
10.6.3
PS E:\mcp\google-search> npm --version
10.2.3
Windows 版本: 10.0.19045.5011

PS E:\mcp\google-search> pnpm debug "search keywords"

> google-search-cli@1.0.0 debug E:\mcp\google-search
> ts-node src/index.ts --no-headless "playwright typescript" "search keywords"

TypeError: Unknown file extension ".ts" for E:\mcp\google-search\src\index.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:141:22)
    at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
    at async link (node:internal/modules/esm/module_job:76:21) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
 ELIFECYCLE  Command failed with exit code 1.

So the debug part of pnpm failed with unknown reason.

I hope to use Edge instead of Chrome, because of my edge proxy web extension . I've changed this part in search.ts

 const platform = os.platform();
 let deviceName = "Desktop Edge"; // 默认使用Chrome

 if (platform === "darwin") {
   // macOS
   deviceName = "Desktop Safari";
 } else if (platform === "win32") {
   // Windows
   deviceName = "Desktop Edge";
 } else if (platform === "linux") {
   // Linux
   deviceName = "Desktop Firefox";
 }

 // 我们使用的Chrome
 deviceName = "Desktop Edge";

While it doesn't works.

I can open the "https://www.google.ca" normally in Edge, But I cannot smoothly use google-search with domain: "https://www.google.ca".

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions