Having SIGTERM issue in Node.js + Express project

vatsal-igeek
FREE

3 months ago

I have deployed a node.js express project and it seemed to be running fine for few seconds, but some npm script is running which is terminating the process and stopping the container. Please check this and let me know what I am missing as I have tried everything and nothing seems to be working.

npm error path /app

npm error command failed

npm error signal SIGTERM

npm error command sh -c node index.js

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-08-05T05_36_32_127Z-debug-0.log

Attachments

$10 Bounty

5 Replies

Railway
BOT

3 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


nizo-developer
FREE

3 months ago

Make sure your index.js includes:

const PORT = process.env.PORT || 3000; app.listen(PORT, () => console.log(`Server running on port ${PORT}`));

And your package.json has:

"scripts": { "start": "node index.js" }

Railway requires your app to listen on process.env.PORT and stay running โ€” otherwise, it will stop the container.


nizo-developer

Make sure your index.js includes:const PORT = process.env.PORT || 3000; app.listen(PORT, () => console.log(`Server running on port ${PORT}`));And your package.json has:"scripts": { "start": "node index.js" }Railway requires your app to listen on process.env.PORT and stay running โ€” otherwise, it will stop the container.

vatsal-igeek
FREE

3 months ago

Yeah, its like this only


vatsal-igeek

Yeah, its like this only

clashing
HOBBY

2 months ago

Can you please provide your server file that is serving the endpoints?


papakrlo
FREE

2 months ago

Hey! The "Stopping Container" and SIGTERM logs that appear after a new deployment refer to the termination of the previous deployment's container, not the new one. You latest deployment is probably fine. Railway will probably make this distinction clearer in the logs at some point...