10 months ago
Im trying to deploy my sveltekit website, i tried everything but i keep getting this in the logs, my website works perfectly fine, but this shows up, what is the reason and should it be like this?
npm error path /app
npm error command failed
npm error signal SIGTERM
npm error command sh -c node build/index.js
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-12-03T23_11_49_776Z-debug-0.log
Attachments
Pinned Solution
10 months ago
update your package.json start script to this : "start": "node build"
and replace your entire config with this:
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
out: 'build',
precompress: false,
envPrefix: ''
})
}
};
export default config;
then go to your Railway project settings and add: NODE_ENV = production and ORIGIN = https://your-app-name.up.railway.app (use your actual railway url)
also create a railway.json in your project :
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm install && npm run build"
},
"deploy": {
"startCommand": "node build",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
push and deploy your deployment should succeed after these changes
4 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 No deployment logs
- 🧵 Loguru logs showing as error
- 🧵 Bun start command logged as error
- 🧵 VIEW LOGS ERROR
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
your start script is using the wrong command. SvelteKit with adapter-node doesn't run with node build/index.js ,that's causing the SIGTERM and command failed errors
10 months ago
update your package.json start script to this : "start": "node build"
and replace your entire config with this:
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
out: 'build',
precompress: false,
envPrefix: ''
})
}
};
export default config;
then go to your Railway project settings and add: NODE_ENV = production and ORIGIN = https://your-app-name.up.railway.app (use your actual railway url)
also create a railway.json in your project :
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm install && npm run build"
},
"deploy": {
"startCommand": "node build",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
push and deploy your deployment should succeed after these changes
domehane
update your `package.json` start script to this : `"start": "node build"` and replace your entire config with this: `import adapter from '@sveltejs/adapter-node';` `import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';` `/** @type {import('@sveltejs/kit').Config} */` `const config = {` ` preprocess: vitePreprocess(),` ` kit: {` ` adapter: adapter({` ` out: 'build',` ` precompress: false,` ` envPrefix: ''` ` })` ` }` `};` `export default config;` then go to your Railway project settings and add: `NODE_ENV` \= `production ` and `ORIGIN` \= `https://your-app-name.up.railway.app` (use your actual railway url) also create a railway.json in your project : `{` ` "$schema": "https://railway.app/railway.schema.json",` ` "build": {` ` "builder": "NIXPACKS",` ` "buildCommand": "npm install && npm run build"` ` },` ` "deploy": {` ` "startCommand": "node build",` ` "restartPolicyType": "ON_FAILURE",` ` "restartPolicyMaxRetries": 10` ` }` `}` push and deploy your deployment should succeed after these changes
10 months ago
thank you, this helped. I was using a scrappy tutorial to set this up, i really appreciate it 🙂
Status changed to Solved brody • 10 months ago