R
Railway•12mo ago
Wael Ghazi

How to use to deploy node.js / TS?

Hi, How to use railway to deploy node.js / TS project from an existing repo? I used Heroku before but not very familiar with railway How to set scripts that do ts complie then starting index from dist? Does railway uses scripts defined in package.json?
15 Replies
Percy
Percy•12mo ago
Project ID: N/A
Fragly
Fragly•12mo ago
yes, railway uses the scripts defined in package.json to use railway, you simply create a new project, provide the github link, add the env variables and you're done! it'll build it and then deploy it for you
Wael Ghazi
Wael GhaziOP•12mo ago
OK, thanks for your help I've done so but got build error though the project is working locally So I don't know if I need some extra config for example?
Fragly
Fragly•12mo ago
You shouldn't need to 🤔 make sure typescript is installed on your project's dev dependencies if you have that, try sending me the build logs using this: https://bookmarklets.up.railway.app/log-downloader/ then we can debug together :)
Wael Ghazi
Wael GhaziOP•12mo ago
Oh Thanks, let me do that The downloader doesn't work or I'm not sure if missing something
Fragly
Fragly•12mo ago
You just need to pop it into your bookmarks, go to your build logs, and then click the bookmark it'll run js code that downloads your buildlogs
Wael Ghazi
Wael GhaziOP•12mo ago
Here's my app log @Fragly
Wael Ghazi
Wael GhaziOP•12mo ago
I had to copy the js code into console So in line #13 you may notice scripts command: rimraf dist && npx tsc && yarn copy-files I guess they're not working properly or something I tried to fix pathes from '../../path/to/some' to './../path/to/some'
Fragly
Fragly•12mo ago
could you send me your package.json?
Wael Ghazi
Wael GhaziOP•12mo ago
Fragly
Fragly•12mo ago
dang, yea I'm not sure why it's not working
Wael Ghazi
Wael GhaziOP•12mo ago
Yep, really strange
Fragly
Fragly•12mo ago
what node version are you using locally?
Wael Ghazi
Wael GhaziOP•12mo ago
v18.17.1
Fragly
Fragly•12mo ago
dang 🤔
Want results from more Discord servers?
Add your server