agentic
agentic copied to clipboard
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)
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.
that worked but i see it now works as a bot. cant it run normally?
that worked but i see it now works as a bot. cant it run normally?
I don’t understand. You want the library not to take the cookies by itself?
You can change the path of the chrome in this piece of code that you can find in the node_modules folder chatgpt at /build/index.js
You can pass executablePath
to override the default. We should definitely use better platform-aware defaults.
@transitive-bullshit I fixed this but I could not make it work yet, what else do I need to config in order to work? Do I need some cookies or credentials to provide? Except for those which I config in the .env that are the email and password of my account
@joao-bermal I'll need more info in order to help.
Try printing out the results of getOpenAIAuth
. Make sure it all of the values are there. tbh I haven't tested on Windows, so something may be different.
Also, make sure you're using the real Chrome executable and not the puppeteer one because Cloudflare tends to block that one. If you post more info, I can help more (node.js version, how you've invoking the demo, all output, what happens in the headful browser, etc).
You can pass
executablePath
to override the default. We should definitely use better platform-aware defaults.
https://github.com/GoogleChrome/chrome-launcher
ChromeLauncher.Launcher.getInstallations()
this code will help you
Hey, I recorded a little demo video, and also I'm sending some images that might help, my node version is v18.12.1. PS: Sorry for the bad English in the video. Hope you can understand.
https://user-images.githubusercontent.com/37602245/207204094-0f85e173-7add-4dd3-8a3c-5f2050afc6de.mp4
@joao-bermal make sure you're setting email
and password
to two separate values in your call to getOpenAIAuth
. Right now, it looks like you're using the same value for both of them.
@transitive-bullshit actually I've realized that and I changed to my email and password but still exacly the same result. I think that's because I'm trying to login with the google account, I'll try to create an account with email and password and see if this changes something.
Only standard email & password is supported for the automated solution at this time.
The browser location issue will be fixed by #126 or #124
Yes, now I've tried to make it work logining with only email and password but it still shows the same error, I think that I should probably pass some information about my ChatGPT like session token and stuff.
that worked but i see it now works as a bot. cant it run normally?
I don’t understand. You want the library not to take the cookies by itself?
sorry i meant not doing this whole open browser operation. is this because of the new restrictions they applied?
@stojanni Yes, this is probably because of the cloudflare protection they implemented
@stojanni the new Cloudflare protections unfortunately made this whole process much more complicated.
Keep in mind that this is providing extremely early access to ChatGPT and is intended to help devs start building awesome stuff on top of it — but it won't be 100% stable until the official API is released, and we don't have any word yet on when that will be.
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.
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?
@gookyn thank's for the windows PR. Yes, I like the idea of CHROME_PATH
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 variablesprocess.env.CHROME_PATH
to override the default chrome path?
can i deploy it in linux vm? when i command npx tsx demos/demo.ts
, show same wrong information.
@tiger233 you can use PUPPETEER_EXECUTABLE_PATH
as the env var