a day ago
Our private GitHub deployment repeatedly fails during dependency installation with npm’s internal error: “Exit handler never called.” It has reproduced with Nixpacks/Node 20 using npm install and Railpack/Node 22 using npm ci. Railway Diagnose reports no specific code or configuration issue and identifies an npm client bug.
6 Replies
a day ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 1 day ago
Status changed to Solved business423 • 1 day ago
a day ago
Repeated npm “Exit handler never called” build failure across Nixpacks and Railpack
service repeatedly fails during dependency installation with npm’s internal error:
Exit handler never called
Timeline:
Nixpacks with Node 20.18.1 failed during npm install.
Nixpacks with Node 22.11.0 failed with the same npm error.
Railpack with Node 22 using npm ci also failed with the same error.
Railway Diagnose could not identify an application-code or configuration problem and described this as an npm client failure.
The failure occurred before protobufjs was updated to 7.5.5, so that update cannot be the original cause.
Railway’s automated agent created a PR that globally enables ignore-scripts=true, but we will not merge it because disabling all dependency lifecycle scripts could create build or runtime problems.
Could a human support engineer please:
Check the backend build logs for process termination, memory exhaustion, cache corruption, or another platform-level cause?
Clear or bypass the build cache and run the deployment in a genuinely fresh build environment?
Confirm whether creating a new temporary service from the same repository would guarantee a separate build cache?
Confirm whether this npm error is a known Railway, Railpack, or build-image issue?
Status changed to Open Railway • 1 day ago
a day ago
It did not work..
business423
It did not work..
a day ago
We completed the documented cache-bypass deployment using NO_CACHE=1 and RAILPACK_DISABLE_CACHES=*. It still failed with npm “Exit handler never called” using Node 22.23.2 and npm 10.9.8. We also set RAILPACK_INSTALL_CMD=node --version && npm --version && npm ci --foreground-scripts, but the full log proves Railpack still executed sh -c npm ci; the override did not take effect, possibly because railpack.json explicitly defines npm ci. There is no package lifecycle failure, package-firewall/DNS error, OOM, or termination signal in the available log. The npm debug log is inside the failed builder at /root/.npm/_logs/2026-09-08T02_24_54_399Z-debug-0.log.
a day ago
so it failed again
We replaced the explicit npm ci command in railpack.json with the diagnostic wrapper previously recommended.
The multiline version failed before npm ran:
exit: 1: thenn: not found
exit code: 127
We then converted the same wrapper into a single-line, semicolon-separated command. It passed local JSON parsing and sh -n validation, but Railway/Railpack again altered or escaped the command and failed before npm ran:
Syntax error: end of file unexpected (expecting "fi")
exit code: 2
Therefore, neither deployment reached npm ci, and we still do not have npm’s debug log.
a day ago
so it failed again
We replaced the explicit npm ci command in railpack.json with the diagnostic wrapper previously recommended.
The multiline version failed before npm ran:
exit: 1: thenn: not found
exit code: 127
We then converted the same wrapper into a single-line, semicolon-separated command. It passed local JSON parsing and sh -n validation, but Railway/Railpack again altered or escaped the command and failed before npm ran:
Syntax error: end of file unexpected (expecting "fi")
exit code: 2
Therefore, neither deployment reached npm ci, and we still do not have npm’s debug log.
17 hours ago
Resolved as of now, thank you
Status changed to Solved dev • about 17 hours ago