bakkot / call-chatgpt

Make a regular phone number you can call to talk to ChatGPT
4 stars 1 forks source link

Error: ENOENT: no such file or directory, open '\C:\call-chatgpt\OPENAI_KEY.txt' #1

Open lmsutools opened 11 months ago

lmsutools commented 11 months ago

Hello, I haven't been able to start the app as I'm always getting this error:

PS C:\call-chatgpt> node call.mjs node:fs:603 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, open '\C:\call-chatgpt\OPENAI_KEY.txt' at Object.openSync (node:fs:603:3) at Module.readFileSync (node:fs:471:35) at file:///C:/call-chatgpt/chatgpt-stream.mjs:9:25 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) { errno: -4058, syscall: 'open', code: 'ENOENT', path: '\C:\call-chatgpt\OPENAI_KEY.txt' }

But the file actually exists. I'm on Windows. Thanks.

bakkot commented 11 months ago

Are you sure it exists? In the directory which has the code, with the correct capitalization?

lmsutools commented 11 months ago

image Yes, it's so weird. I tried to use relative path and is the same.

bakkot commented 11 months ago

Only thing I can think is the leading slash, which, I don't know how that would get there. I don't develop on Windows I'm afraid. You could switch out the path.join(__dirname, 'OPENAI_KEY.txt') for just 'OPENAI_KEY.txt' and see if that works.

Failing that, you could always hardcode the key (and domain), as long as you don't put the code anywhere public.