-
Notifications
You must be signed in to change notification settings - Fork 140
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 build fails on 'npm prune' #304
Comments
@josep11 Thanks for raising the issue.
|
Hello @hawflau, about the 2nd question: yes, it is the same user running |
@josep11 Thanks for the information. I could reproduce the same as you saw. I found the error came from Can you help us understand more about your use case? like, is there any reason that you must run |
Also, moving to Lambda Builder since it's a behavior in Lambda Builder |
The idea is to run the tests when I do the build so that if they don't pass the build fails. That is one of the reasons why I use a custom Makefile (attached in the first message) |
@josep11 looking at the problem, it seems like it is caused by relative symlinks. Is there a way to generate those symlinks with absolute path, which should work on the same machine? |
Thanks for creating this issue. Closing due to inactivity, please feel free to reopen this issue if there are any findings or create a new issue if you have any other feedback. |
Description:
I am using a custom Makefile to copy only some artifacts to the .aws-sam folder and to perform some tasks.
I am running
sam build
and it seems that there is a permission problem withnpm prune --production
when it tries to remove the unnecessary npm dev packages.If I run
npm prune --production
from the terminal it works perfectly.Steps to reproduce:
Have a node.js with some npm dependencies, src, config folders and handler.js on the root
This is the Makefile:
Even being a really bad practice I changed the conflicting line with
sudo npm prune --production
and it run without problems.Observed result:
If the modules to be removed are installed using
sam
command (in the build) then everything works properly, but if they were installed by my OS user (straight from the terminal) then it doesn't work. The output is:Expected result:
the folders under node_modules to be deleted by
sam
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.31.0Those are my dependencies in package.json:
The text was updated successfully, but these errors were encountered: