My deployment crushed
samuelamofa
FREEOP

3 months ago

npm error workspace rms-backend@1.0.0

npm error location /app/backend

/app/node_modules/.prisma/client/default.js:43

throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');

^

Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.

at new PrismaClient (/app/node_modules/.prisma/client/default.js:43:11)

at Object.<anonymous> (/app/backend/config/database.js:3:16)

at Module._compile (node:internal/modules/cjs/loader:1706:14)

at Object..js (node:internal/modules/cjs/loader:1839:10)

at Module.load (node:internal/modules/cjs/loader:1441:32)

at Function._load (node:internal/modules/cjs/loader:1263:12)

at TracingChannel.traceSync (node:diagnostics_channel:328:14)

at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)

at Module.require (node:internal/modules/cjs/loader:1463:12)

at require (node:internal/modules/helpers:147:16)

Node.js v22.21.1

npm error Lifecycle script start failed with error:

npm error code 1

npm error path /app/backend

npm error command failed

npm error command sh -c node server.js

$10 Bounty

10 Replies

Have you tried properly initializing the Prisma client within your code?


0x5b62656e5d

Have you tried properly initializing the Prisma client within your code?

samuelamofa
FREEOP

3 months ago

yes I did


Did you generate the client during the build process?


samuelamofa
FREEOP

3 months ago

no


You need to generate the client during the build process. Prisma client files are not committed by default.


samuelamofa
FREEOP

3 months ago

How do I do that. I'm new to railway


That depends on how your application is built. You need to generate the prisma client files after you have installed all node packages. You can either do it by Docker or via Railpack configuration file.


Status changed to Open brody 3 months ago


samuelamofa
FREEOP

3 months ago

thanks let me try this out


samuelamofa
FREEOP

3 months ago

this it the error I get when I added the prestart

npm ci

455ms

npm warn config production Use --omit=dev instead.

npm error code EUSAGE

npm error

npm error The npm ci command can only install with an existing package-lock.json or

npm error npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or

npm error later to generate a package-lock.json file, then try again.

npm error

npm error Clean install a project

npm error

npm error Usage:

npm error npm ci

npm error

npm error Options:

npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]

npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]

npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]

npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]

npm error [--no-bin-links] [--no-fund] [--dry-run]

npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]

npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]

npm error

npm error aliases: clean-install, ic, install-clean, isntall-clean

npm error

npm error Run "npm help ci" for more info

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-12-23T16_04_25_144Z-debug-0.log

ERROR: failed to build: failed to solve: process "npm ci" did not complete successfully: exit code: 1


You need to commit your lockfile.


Loading...