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.Solution:Jump to solution
set the start command in the railway service settings to the start script command
16 Replies
Project ID:
ee5f48cd-ecf0-40ae-a417-8f8072a5dcd5
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?
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?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.
that means your app did not respond.
are you sure you have the domain pointing to the correct port?
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?
you have
PGHOST="${{RAILWAY_PRIVATE_DOMAIN}}"
but it needs to be PGHOST="${{meticulous-empathy.RAILWAY_PRIVATE_DOMAIN}}"
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..
wait but the curl works fine now, the whole app works now as well :HAHAHA:
what's your start script?
"scripts": {
"test": "jest",
"start": "node dist/server.js",
"build": "tsc"
},
I run npm run build, then npm run startSolution
set the start command in the railway service settings to the start script command
sorry do you mean set it to "npm run start && node dist/server.js"
no, just the actual command
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!!!
thank you, happy to help