realcoloride / node_characterai

Unofficial Character AI wrapper for node.
https://beta.character.ai/
346 stars 71 forks source link

Error: Failed to launch the browser process puppeteer #25

Closed itsreimau closed 1 year ago

itsreimau commented 1 year ago

I have an error here.

Information ECMAScript: 6 Hosting: Repl.it

itsreimau commented 1 year ago

I'm building a WhatsApp Bot using @adiwajshing/baileys.

// ai.js

import CharacterAI from 'node_characterai';
const characterAI = new CharacterAI();

export default async function({bot, command_name, input, message, prefix}) {
  if (!input) return message.reply(`*ChatGPT*\nMengobrol dengan AI.\n\nPenggunaan: ${prefix + command_name} <text>\nContoh: ${prefix + command_name} Apa itu AI?\n\nCatatan: ChatGPT ini dari character.ai, bukan ChatGPT asli tapi clone yang menurut saya bisa menggantikannya.`);

  (async() => {
      await characterAI.authenticateWithToken('token'); // I already have the access token, removed due to privacy issues

      const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw" // ChatGPT
      const chat = await characterAI.createOrContinueChat(characterId);
      const response = await chat.sendAndAwaitResponse(input, true)
      message.reply(response);
    })();
}
realcoloride commented 1 year ago

Hello! I do not use replit sadly so I will mention this issue in #17 as a note. Users have been able to use it on Heroku or local. What version of the package do you use?

Naozumi520 commented 1 year ago

Any more info? Like chromium not found or what?

itsreimau commented 1 year ago

Any more info? Like chromium not found or what?

Nothing else, just announced that the browser failed to launch

itsreimau commented 1 year ago

Hello! I do not use replit sadly so I will mention this issue in #17 as a note. Users have been able to use it on Heroku or local. What version of the package do you use?

It turned out that after I searched, Puppeteer really didn't work on Replit, I was disappointed with this. Hope this is fixed soon.

JcynR commented 1 year ago

I have the same problem, on windows...

node_modules\@puppeteer\browsers\lib\cjs\launch.js:262

                reject(new Error([
                       ^

Error: Failed to launch the browser process!

TROUBLESHOOTING: https://pptr.dev/troubleshooting
realcoloride commented 1 year ago

try unistalling and reinstalling the puppeteer package

Jeffgrey91 commented 1 year ago

@realcoloride The issue is still there.

I fixed it by setting the puppeteerPath in the Requester class puppeteerPath = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";

realcoloride commented 1 year ago

Hello again, whats the problem exactly?