3 months ago
Railpack's pnpm detection always uses --frozen-lockfile, which cannot be overridden. This breaks deployments for pnpm monorepos where the service's Root Directory differs from the lockfile location.
Environment:
Railpack 0.15.3
pnpm 10.17.0
Monorepo with Root Directory =
frontend/and
pnpm-lock.yaml at repo root
Problem: When Railway's Root Directory is set to a subdirectory (e.g.,
frontend/), Railpack copies both the subdirectory's package.json and the root pnpm-lock.yaml, then runs:
pnpm install --frozen-lockfile --prefer-offlineThis fails with
ERR_PNPM_OUTDATED_LOCKFILEbecause pnpm interprets the workspace lockfile differently when run from a subdirectory context.
What We Tried (all failed with Railpack):
Creating
frontend/.npmrc with
frozen-lockfile=false- CLI args override config files
Using
installCommandin
railway.toml - Railpack ignores this setting
Regenerating the lockfile multiple ways - Railpack's caching causes stale package.json to be used
Workaround: We had to switch to NIXPACKS with a custom install command:
toml# frontend/nixpacks.toml
[phases.install]
cmds = ["pnpm install --no-frozen-lockfile"]
Feature Request: Add a config option to Railpack to disable
--frozen-lockfile, such as:
Environment variable:
RAILPACK_PNPM_NO_FROZEN_LOCKFILE=trueOr config in
railway.toml:
frozenLockfile = false
Pinned Solution
3 months ago
set this environment variable in your service settings:
RAILPACK_INSTALL_CMD=pnpm install --no-frozen-lockfile
it will override the default frozen lockfile flag
4 Replies
3 months ago
set this environment variable in your service settings:
RAILPACK_INSTALL_CMD=pnpm install --no-frozen-lockfile
it will override the default frozen lockfile flag
3 months ago
Thanks for outlining the issue. We should improve how this is handled on railpack to detect this case. Added this to the railpack TODO!
3 months ago
@fengning-starsend did the cmd works for you now ?
Status changed to Solved brody • 3 months ago
