Hey folks, by reading the latest comments, I think the issue only occurs when trying to deploy from CLI, correct? Did I miss someone who is having this issue with deploying from Netlify Build pipeline? If so, please let me know.
About the CLI problem, it seems to be a little tough to handle. Node.js installs platform-specific binary for Sharp. So when you use in on devices other than Linux-based OSs, you’d face this problem as AWS Lambda runs Linux-based dependencies. So when you bundle from CLI, the macOS or Windows-specific dependency doesn’t work there and thus the issue.
We’d try to come up with a solution to tackle this, but I believe, at this point your options are:
- Build using Netlify Build
- Use some other Linux-based build system like GitHub Actions and publish the deploy to Netlify.