GoogleBard icon indicating copy to clipboard operation
GoogleBard copied to clipboard

ERR_REQUIRE_ESM

Open chinazhaoht opened this issue 1 year ago • 1 comments

project/node_modules/ts-node/dist/index.js:851 return old(m, filename); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module

chinazhaoht avatar Oct 12 '23 03:10 chinazhaoht

const bardModule = await import('googlebard'); const Bard = bardModule.Bard;

let cookies = __Secure-1PSID=<YOUR_COOKIE>; let bot = new Bard(cookies, { inMemory: false, savePath: "./conversations.json", // this is being done to save crucial information about the conversation so the bot remembers it });

let conversationId = "test_id";

let response = await bot.ask("My name is Mehul", conversationId); console.log(response);

(Flow the step)

yeasin6152 avatar Jan 10 '24 23:01 yeasin6152