chatgpt-api: Error: Failed to launch the browser process

Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (C:\Users\User\Desktop\New folder\node_modules\puppeteer-core\lib\cjs\puppeteer\node\BrowserRunner.js:299:20)
    at ChildProcess.<anonymous> (C:\Users\User\Desktop\New folder\node_modules\puppeteer-core\lib\cjs\puppeteer\node\BrowserRunner.js:293:24)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (C:\Users\User\Desktop\New folder\node_modules\puppeteer-core\lib\cjs\puppeteer\node\BrowserRunner.js:299:20)
    at ChildProcess.<anonymous> (C:\Users\User\Desktop\New folder\node_modules\puppeteer-core\lib\cjs\puppeteer\node\BrowserRunner.js:293:24)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 22 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I resolved, at least momentarily, by changing the following line in openai-auth.ts#129 to the real path of Chrome in my PC, which I got by going on the page chrome://version in the browser and copying the value Executable Path.

This makes the library work with little effort, but it’s definitely an incorrect method. We have to wait for the developer to complete the function to make everything work without changes from us.

The original bug for this issue has been resolved in: https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v2.3.1

If you have other problems, please open a new issue with a detailed account of the problem you’re running into.

@transitive-bullshit

I cloned the latest version and wanted to run the demos, but this problem occurred.

Is it possible to get command line parameters npx tsx demos/demo.ts --chrome-path=xxx or environment variables process.env.CHROME_PATH to override the default chrome path?

You can pass executablePath to override the default. We should definitely use better platform-aware defaults.