Files
Michael BiancoandGitHub ac1fbbafa3 feat(node): gracefully handle out of sync package-lock.json (#643)
* feat(node): add out-of-sync package-lock npm example

- Add new example demonstrating npm ci failure with an out-of-sync lockfile
- Include test configuration and documentation for the scenario

Generated-by: aiautocommit

* fix(node): fallback to npm install when lockfile is missing

- Always use `npm install` for npm projects to prevent build failures when `package-lock.json` is missing.
- Log a warning when the lockfile is absent to encourage generating one.
- Clean up outdated comments regarding package manifest parsing.

Generated-by: aiautocommit

* test(core): update test snapshots for npm install changes

Generated-by: aiautocommit

* feat(node): add npm ci recommendation and railpack example

- Document recommendations for preferring `npm ci` over `npm install` for Node.js projects using npm.
- Add a corresponding `railpack.json` example demonstrating how to configure deterministic installs with `npm ci`.

Generated-by: aiautocommit

* refactor(core): use npm ci in build plan for node npm examples

- Switch from `npm install` to `npm ci` for deterministic builds when package-lock.json is present.
- Remove redundant cache directory creation step.

Generated-by: aiautocommit

* feat(node): add suggestions for missing lockfiles

- Log suggestions when `package-lock.json` or `pnpm-lock.yaml` is missing to encourage deterministic installs.
- Update architecture documentation with guidance on committing `package-lock.json`.

Generated-by: aiautocommit

* test(core): update out-of-sync package-lock snapshot for builder changes

Generated-by: aiautocommit

* feat(node): allow overriding npm install command via config variable

Generated-by: aiautocommit

* docs(node): document RAILPACK_NODE_NPM_INSTALL environment variable

Generated-by: aiautocommit

* docs: recommend committing all package manager lockfiles

Generated-by: aiautocommit
2026-07-27 06:50:07 -06:00

21 lines
735 B
JSON

{
"$schema": "https://schema.railpack.com",
"steps": {
"install": {
// Railpack defaults to `npm install` so out-of-sync lockfiles still succeed.
// Opt into `npm ci` when the lockfile is kept in sync for deterministic installs.
//
// Configuring a step auto-adds it to deploy with include: ["."]. Use an empty
// deployOutputs so install is not copied into the final image; node_modules
// still reach the image via the build step.
"deployOutputs": [],
"commands": [
{ "path": "/app/node_modules/.bin" },
{ "src": "package-lock.json", "dest": "package-lock.json" },
{ "src": "package.json", "dest": "package.json" },
"npm ci"
]
}
}
}