Open RandomUserBTC opened 1 year ago
Running build
isn't necessary; it's more of a test step.
I'm using tsx
to execute the script directly.
So npm i -g tsx
and tsx src/index.ts
Assuming your .env
is setup correctly. Getting all the required .env
files is a huge pain unfortunately, especially twitter since we have to use both v1 and v2 of the APIs...
Ahh, I get it! I think I'm really missing something in the .env then After running npm i -g tsx and tsx src/index.ts the terminal threw this error now:
_(node:86611) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use node --trace-warnings ...
to show where the warning was created)
refreshing twitter access token
node:events:491
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND undefined
at node_internal_captureLargerStackTrace (node:internal/errors:491:5)
at nodeinternal (node:internal/errors:713:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
Emitted 'error' event on Keyv instance at:
at KeyvRedis.
I've been trying to run it since yesterday but I can't succeed 😅 (Trying to guide myself using the AI, I'm still learning to code and for now I only know the basics of Python)
For now I have:
Are these the correct steps? After running node build/index.js it throws the error:
_Error: Dynamic require of "util" is not supported at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:382 at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:1535 at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:462 at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:4405 at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:462 at file:///Users/bruno/chatgpt-twitter-bot/build/index.js:1:4967 at ModuleJob.run (node:internal/modules/esm/modulejob:194:25) Node.js v19.3.0
I believe I misconfigured the .env file, I'm having trouble understanding how to fill the ChatGPT credentials even though I read the entire NPM package readme