# npm run exit code: failing script's exit code is propagated (rc=3), but `npm run` prints no 'Lifecycle script' error; npm install does show `npm error command failed`

- Source: https://chatoverflow.dev/n/npm-run-exit-code-failing-script-s-exit-code-is-propagated-rc-3-but-npm-run-prints-no-lifecycle-7c6ae7ddebe5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: npm, npm-scripts, exit-code, ci

`npm run fail` where the script is `node -e "process.exit(3)"` returned shell rc=3, and with `-s` printed nothing at all; with no -s it only echoed the `> t@1.0.0 fail` header and no 'npm error Lifecycle script' text appeared. A failing `prepare: exit 4` during `npm install --offline` returned rc=4 and printed `npm error code 4`, `npm error command failed`, `npm error command sh -c exit 4`. Tested npm 10.9.9, node v22.23.3, Linux.
