Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect lockfile when building Node code #317

Closed
wants to merge 11 commits into from

Conversation

torresxb1
Copy link
Contributor

@torresxb1 torresxb1 commented Jan 21, 2022

Issue #, if available:

Description of changes:
If package-lock.json is found, copies it over and uses npm ci instead of npm install.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

lockfile_path = osutils.joinpath(source_dir, "package-lock.json")
shrinkwrap_path = osutils.joinpath(source_dir, "npm-shrinkwrap.json")

if osutils.file_exists(lockfile_path) or osutils.file_exists(shrinkwrap_path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question - do we want to check if npm ci is available? npm ci is available since npm 6.x and nodejs12 comes with npm6.9+. nodejs10 is going to be deprecated in Lambda pretty soon. It seems safe but we might want to confirm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we already have a PR out to remove Node10 support #319 and Lambda is dropping all support very soon too (Feb 14) https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html. We could potentially add a condition to check the npm version, fallback to npm install if needed and remove it after that date.

@mildaniel
Copy link
Contributor

Going to close this PR and continue in #338.

@mildaniel mildaniel closed this Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants