Skip to content

Use package-lock.json and npm ci for predictable dependencies#194

Merged
danielfrankcom merged 2 commits intomainfrom
dev/frankcom/node-lock-files
Oct 3, 2025
Merged

Use package-lock.json and npm ci for predictable dependencies#194
danielfrankcom merged 2 commits intomainfrom
dev/frankcom/node-lock-files

Conversation

@danielfrankcom
Copy link
Copy Markdown
Contributor

This PR ensures the dependencies described by the Node.js packages in the repo will use the same dependencies across all developer machines, including the workflows.

The change adds package-lock.json files where they were previously missing, and swaps the workflow files to use npm ci to avoid dependency versions being changed on the fly. In at least one case the npm ci failed when testing locally since the package.json and package-lock.json files were out of sync which should never happen on main.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.

@vic-tsang
Copy link
Copy Markdown
Contributor

my question is what happens if we need to update the packages we need to update the package-lock.json ?

@danielfrankcom
Copy link
Copy Markdown
Contributor Author

we need to update the package-lock.json ?

Yes, this is a standard part of the Node.js ecosystem. Previously we did not actually control the versions used for some of these samples, we just used a version based on the suggested range from the package.json file.

This change will let us make sure we are using the same version everywhere to prevent "works on my machine" issues.

@danielfrankcom danielfrankcom merged commit 6487d29 into main Oct 3, 2025
20 checks passed
@danielfrankcom danielfrankcom deleted the dev/frankcom/node-lock-files branch October 3, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants