#node problem?

45 messages · Page 1 of 1 (latest)

halcyon ivy
#

trying to host my discord.js bot and i keep getting some funky error

        throw e;
        ^
Error: /app/node_modules/sqlite3/build/Release/node_sqlite3.node: invalid ELF header
    at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at bindings (/app/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/app/node_modules/sqlite3/lib/sqlite3-binding.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'ERR_DLOPEN_FAILED'
}
Node.js v20.18.1```

if i run the code locally it works perfectly fine, but if i do it on any other hosting platform i always get this error. not sure what to do, tried everything chatgpt recommended
near shore
#

update your server OS and install glibc

halcyon ivy
near shore
#

You're running on Windows servers?

#

💀

halcyon ivy
#

?? yea im on windows

near shore
#

Your hosting platform is running Windows as well?

#

I mean just delete the node_modules, run npm i again in your directory and it should be fine?

halcyon ivy
#

i did

#

several times

#

like i genuinely dont know what could be wrong

#

chatgpt has never failed me so much in one query as it has with this

#

when i run it just in vscode it works perfectly so theres no errors in it and i have all my packages utd

near shore
#

So it works on your machine but not on the server?

halcyon ivy
#

yeah exactly

near shore
#

How'd you copy the bot to the server?

halcyon ivy
#

wait wdym

#

sorry its 8am no sleep

#

when i run it on vscode

#

locally

#

it works

#

database works

#

commands work

#

its all good

#

when i put everything into like an actual hosting service

#

i always get that error

#

its been 3 services so i legit dunno what to do

#

ive reinstalled all my shit like 40 times

near shore
halcyon ivy
#

the main way they do it is you make your project folder into a zip file and then you drag it in and it unarchives and runs it

#

one of the hosting services

near shore
#

where's the node_modules directory there?

halcyon ivy
#

it never shows for some reason but it is there

near shore
#

if you don't have the dependencies installed of course it won't work

halcyon ivy
#

i do its in another section

#

and yeah its also in the zip i went to check just incase

near shore
#

You'd probably be better off talking to their support, who knows what they're doing behind the scenes

halcyon ivy
near shore
#

(unless you can just SSH into your server)

modest cliff
#

i sus they run it on a windows client only? 😄
If so firewall settings.

near shore