npm: use "ci" (cleaninstall) if lockfiles are present#580
Merged
floydspace merged 1 commit intofloydspace:masterfrom Dec 20, 2025
Merged
npm: use "ci" (cleaninstall) if lockfiles are present#580floydspace merged 1 commit intofloydspace:masterfrom
floydspace merged 1 commit intofloydspace:masterfrom
Conversation
floydspace
requested changes
Dec 19, 2025
Contributor
Author
range-diff: v2: reformat and propagate constructor argument |
Contributor
Author
|
Thanks! I don't have a full node install setup locally at the moment, so if there's any way for me to use the CI here more readily, that might help. Otherwise I'll keep at it and see what I can do. |
Lockfiles, explicitly designed for reproducible builds, are ignored by the npm packager implementation of the plugin. Thus `sls package` will attempt to install different versions of dependencies after resolving them if it can (due to `npm install`). This makes it harder to achieve reproducible builds and reliable deployments. When a lockfile is present for npm, use the cleaninstall command instead to install from the lockfile (also saving time on resolution). Use the pattern in the Yarn packager implementation, allowing this behavior to be tweaked by the use of packager options `ignoreLockfile`. Since that configuration defaults to `false` [1], this is a breaking change for npm users. [1]: https://www.serverless.com/plugins/serverless-esbuild#packager-options
Contributor
Author
|
Ok, I managed to set things up locally and run tests. range-diff: v3: fix testsHowever, 🤷 |
floydspace
approved these changes
Dec 20, 2025
Owner
|
No worries, pipeline runs e2e tests and they seem green. So I consider it is all sorted |
|
🎉 This PR is included in version 1.57.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At work, we sometimes find that
sls packagefails because npm has resolved anewer version than is available in our mirrors; as best as we can tell, this is
because the esbuild plugin is running
npm installinstead ofnpm ci. But wewant a fast, reproducible, known build, favoring the latter. This PR implements
that (see the commit message for details).
If there's a way to make this change non-breaking, I'm all ears. It seems
reasonable to want to toggle the behavior using the existing configuration.