-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sam package fails to include node_modules when --template-file is specified #908
Comments
@greensopinion Thanks for creating the issue but what you are seeing is expected. When passing in Closing since this is the expected behavior. |
@jfuss thanks for the clarification, that helps a lot. Unless I'm mistaken, it looks like the template README might need updating, since the steps provided there lead to this problem. Would it make sense to update places where |
@greensopinion We should just remove the A PR with the update would be great! |
Remove --template-file option from sam package example in the nodejs template README.md This corrects a problem where the node_modules folder was not included in the package artifact deployed to s3
@jfuss anything left to do here? It looks to me as though the CI test failure is unrelated to this change:
|
@greensopinion This was addressed in #849. I didn't realize that previously, so sorry about that. The the integ tests that fails is flaky on Travis. We have it captured in #857 but you can safely ignore this failure. |
No problem @jfuss thanks. |
Released in v0.11.0 Closing |
I stumbled upon this when looking up another issue. I just wanted to share that the |
Just adding that also check for |
"When using package with build, you can omit the --template-file from the command. This will tell sam to look for default locations for templates (ones produced by sam build and the default template.[yaml|yml])." What if I need to use a file that isn't the default template.yaml?
When I run a |
Not sure if this helps, If you are still facing this issue, I upgraded my SAM CLI from |
Description
Using a function created using
sam init --runtime nodejs --name hello-world
, the deployed artifact on s3 does not include the node_modules folder. This results in a runtime error:Steps to reproduce
Run the following commands in order (per the README.md):
sam init --runtime nodejs --name hello-world-example
sam build
sam package --template-file template.yaml --output-template-file packaged.yaml --s3-bucket getting-started2
Observe that the s3 file created, when unzipped, does not contain a
node_modules
folder. The .aws-sam/build/HelloWorldFunction/node_modules folder is present.If step 3 is replaced with
sam package --s3-bucket getting-started2
the s3 file created does include anode_modules
folder with all of the expected files/folders.Observed result
Expected result
The file uploaded to s3 should include the node_modules folder.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:SAM CLI, version 0.9.0
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: