build errors as of recently
0xinuarashi
PROOP

2 months ago

never had errors with builds until recently.

npm ci

471ms

npm

WARN

prepare removing existing node_modules/ before installation

npm

ERR!

Cannot read property 'dotenv' of undefined

npm ERR! A complete log of this run can be found in:

npm

ERR!

/root/.npm/_logs/2025-10-08T04_00_28_441Z-debug.log

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

keeps getting these errors.

package.json has dotenv, and my repo doesnt have a node_modules folder.

Solved

3 Replies

Railway
BOT

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


0xinuarashi
PROOP

2 months ago

reverting back from railpack to nixpack solves this for now.


echohack
EMPLOYEE

2 months ago

Hiya!

Can you link us directly to the failing build?

I suspect this might be due to a lockfile that needs to be updated that might change dynamically during the build. But it could be another issue as well. We'll have to see the full log to understand.

Sometimes there can be lockfile issues where it changes when running npm ci. This can happen if the lockfile is out of date or if there is platform specific things in the lockfile. Nixpacks is building successfully because it does not install/build with the --locked flag.

You can fix this with Railpack by setting these environment variables

RAILPACK_INSTALL_CMD=npm ci --no-dev --frozen
RAILPACK_BUILD_CMD=npm ci --no-dev --frozen

Status changed to Awaiting User Response Railway 2 months ago


Railway
BOT

2 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 2 months ago


Loading...