Andrésjajan't
Andrésjajan't
RRailway
Created by Andrésjajan't on 7/31/2024 in #✋|help
I can't get my Railway image working with better-sqlite3
The problem I have is that, when deploying, I get an error with the better-sqlite3 module and according to my research it is because it creates a different .bin depending on the OS. I am currently using Windows and everything works fine locally, so I assume that the Railway image will be on another OS (Unix-based) and that is why I get an error. I tried setting the following "npm run install" as the initial deploy command (from the options Railway gives me), to install the dependencies from Railway itself. However, this does not work for me and I keep getting the same error. ERROR: node:internal/modules/cjs/loader:1460 return process.dlopen(module, path.toNamespacedPath(filename)); ^ Error: /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header at Module._extensions..node (node:internal/modules/cjs/loader:1460:18) at Module.load (node:internal/modules/cjs/loader:1203:32) at Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at bindings (/app/node_modules/bindings/bindings.js:112:48) at new Database (/app/node_modules/better-sqlite3/lib/database.js:48:64) at file:///app/src/models/Usuarios.js:3:12 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:337:24) { code: 'ERR_DLOPEN_FAILED' } Node.js v18.20.2
8 replies