-
Notifications
You must be signed in to change notification settings - Fork 141
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
Conversation
7c41fb8
to
2b7c488
Compare
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Going to close this PR and continue in #338. |
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.