my api wont start on railway
i tried remvoing nodemon from my start script and I also tried in my start script using "node index.js" and only "index.js" nothing works
project id: 9ca93930-ec44-4d40-81ae-5a2f6b7c6928
14 Replies
Project ID:
9ca93930-ec44-4d40-81ae-5a2f6b7c6928
you definitely need to have node prefixed to the start command
node index.js
are you building with a dockerfile or nixpacks?first screenshot is with "node" prefix. Nixpacks
any help with this?
not at the moment, I will circle around to this when I have the time
i had problems with the bcrypt library due to it's use of C++ bindings.
you can consider using this: https://www.npmjs.com/package/bcryptjs.
be aware that it's slower than the one you're using (about 30%) but everything else stays the same (even the API).
I just did this, uninstalled bcrypt and installed bcryptjs, unfortunately it didn't work, I still get this error
uhmm that wasn't supposed to happen as the bcryptjs is purely javascript.
what error are you getting to be sure?
Oh, I messed up, forgot to change start script to node index.js after chaning my bcrypt to bcryptjs, it works now thanks!
thanks thalles! 🙂
Never ending errors with this deployment. Now my server is up and running, but I can't connect to it. Trying out my https://ecommerce-production.up.railway.app/api/auth/test test route to see if api is working and which should respond with "ok" but I get an error saying "Application failed to respond". So, my server is up and running yet its not? What am I missing out guys?
is your API listening on the correct port? railway auto inject a env variable called "PORT"
I've sent you this before, please read it this time
https://docs.railway.app/troubleshoot/fixing-common-errors
I've found my solution, the problem was indeed in port. everything works now, thanks!
ABRD = always be reading documentation