Error in logs when deploying (path /app,command failed,signal SIGTERM etc)
viktor234213
FREEOP

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

Solved$10 Bounty

Pinned Solution

domehane
FREE

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

Railway
BOT

10 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!


domehane
FREE

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


domehane
FREE

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

viktor234213
FREEOP

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...