#Help getting application running

22 messages · Page 1 of 1 (latest)

near pulsar
#

I'm a software engineer and new to Railway but not much of an infra guy.. I'm trying to get an application running but having trouble. First off, the package.json does not have a start script. I'm not sure what that should be.. Can someone here help?

subtle kindleBOT
#

Project ID: N/A

near pulsar
#

eff4fdbb-16e0-4ffb-bee2-4ad13f2f307e

sacred sapphire
near pulsar
#

Hi, yes node

sacred sapphire
#

then basically in your package.json under scripts simply specify a command to start your application, for example:

"scripts": {
  "start": "node dist/server.js"
}
#

you're also able to specify a start command directly on Railway without touching code, in case you want that let me know

near pulsar
#

This is an existing application that I forked.. not sure those solutions will work

sacred sapphire
near pulsar
sacred sapphire
#

If that doesn't work, we can try another command

near pulsar
#

I did try node dist/app.js and that didn't work, but I'll try yours

sacred sapphire
#

Oh then try to specify it via environment variable, set the following on your service:

RAILPACK_START_CMD=node dist/app.js
near pulsar
#

with node dist/app.mjs the deployment finishes, but then it crashes

#

and I see a bunch of these:Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/node_modules/lodash/debounce' imported from /app/dist/app.mjs

sacred sapphire
#

give me a minute, I'm looking at the code.

sacred sapphire
#

hey, I struggled a little bit on trying to run it and I got it running by following the instructions but I feel like it's wrong...
the project is saying to run it on development mode which is a bit weird.

#

anyway, i'll see i can find other ways around it

near pulsar
#

Thanks, I appreciate that. Can you share what you did to get it working?

sacred sapphire
fallow carbonBOT
#

New reply sent from Help Station thread:

How do I use the Docker file within Railway?
I think you need to have a Dockerfile at the root of the project OR point the service settings to Dockerfile path

You're seeing this because this thread has been automatically linked to the Help Station thread.