PER(ts)N project deployment error: npm ERR! path /app. I don't know why "app" is here

project id: ee5f48cd-ecf0-40ae-a417-8f8072a5dcd5 It runs with no errors locally. But in deployment, it gives errors. I'm not sure what "path /app" means. I set the root directory to "/server", which has nothing to do with app folder for the front-end. And how can I find the log file? I tried to use railway CLI and run $railway run cat /root/.npm/_logs/2024-09-01T22_01_25_321Z-debug-0.log but it says no such file or directory.
No description
Solution:
set the start command in the railway service settings to the start script command
Jump to solution
16 Replies
Percy
Percy3mo ago
Project ID: ee5f48cd-ecf0-40ae-a417-8f8072a5dcd5
Silvan Soeters
Silvan Soeters3mo ago
I'm getting the same type of errors and can't seem to access the log file. I'm losing it. Why aren't all logs available at Logs in the dashboard?
No description
Brody
Brody3mo ago
the command railway run runs the given command locally, not on your deployment, you would not be able to access that log file, and you also don't need to, as it wouldn't tell you anything useful anyway. at what point in your deployment lifecycle are you seeing this error?
whatsmynameagain
whatsmynameagainOP3mo ago
The build stage was fine, only in the deployment stage. btw I try to use curl to make a GET request, it returns with an error 502 Application failed to respond. It was fine when running locally too.
Brody
Brody3mo ago
that means your app did not respond. are you sure you have the domain pointing to the correct port?
whatsmynameagain
whatsmynameagainOP3mo ago
Actually I just added a log to my db.ts file, and it seems like a DB issue (pic1).. But at the DB, although there are some red marks (pic2), it says "database system is ready to accept connections" eventually so I guess it's fine?
No description
No description
Brody
Brody3mo ago
you have PGHOST="${{RAILWAY_PRIVATE_DOMAIN}}" but it needs to be PGHOST="${{meticulous-empathy.RAILWAY_PRIVATE_DOMAIN}}"
whatsmynameagain
whatsmynameagainOP3mo ago
I used to manually paste all those values from my DB variables, so it might be because I accidentlly changed it... I now changed them all to the format above. The DB issue is gone, but the old problem is still persistent..
No description
whatsmynameagain
whatsmynameagainOP3mo ago
wait but the curl works fine now, the whole app works now as well :HAHAHA:
Brody
Brody3mo ago
what's your start script?
whatsmynameagain
whatsmynameagainOP3mo ago
"scripts": { "test": "jest", "start": "node dist/server.js", "build": "tsc" }, I run npm run build, then npm run start
Solution
Brody
Brody3mo ago
set the start command in the railway service settings to the start script command
whatsmynameagain
whatsmynameagainOP3mo ago
sorry do you mean set it to "npm run start && node dist/server.js"
Brody
Brody3mo ago
no, just the actual command
whatsmynameagain
whatsmynameagainOP3mo ago
Ahh the error is gone!! Thank you so much Brody!! I spent almost a day on this alone, but you just pointed the errors out within minutes, you are amazing!!!
Brody
Brody3mo ago
thank you, happy to help
Want results from more Discord servers?
Add your server