I am pretty new to aws amplify and have an amplify app that has a backend lambda function which uses sharp as a dependency. When I push to git to trigger a deploy, my build is failing I think due to vips/vips8
a sharp dependency not being found.
Relevant log
2022-05-31T18:26:18.714Z [INFO]: [0mError: Packaging lambda function failed with the error [0m
[0mCommand failed with exit code 1: npm install --no-bin-links --production[0m
[0msh: prebuild-install: command not found[0m
[0m../src/common.cc:24:10: fatal error: vips/vips8: [0m
[0m #include <vips/vips8>[0m
[0m ^~~~~~~~~~~~[0m
[0mcompilation terminated.[0m
[0mmake: *** [Release/obj.target/sharp-linux-x64/src/common.o] Error 1[0m
[0mgyp ERR! build error [0m
[0mgyp ERR! stack Error: `make` failed with exit code: 2[0m
[0mgyp ERR! stack at ChildProcess.onExit (/root/.nvm/versions/node/v14.19.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)[0m
[0mgyp ERR! stack at ChildProcess.emit (events.js:400:28)[0m
[0mgyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)[0m
[0mgyp ERR! System Linux 4.14.246-187.474.amzn2.x86_64[0m
[0mgyp ERR! command "/root/.nvm/versions/node/v14.19.0/bin/node" "/root/.nvm/versions/node/v14.19.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"[0m
[0mgyp ERR! cwd /codebuild/output/src927006233/src/create-react-app-auth-amplify/amplify/backend/function/S3Trigger71b5b76d/src/node_modules/sharp[0m
[0mgyp ERR! node -v v14.19.0[0m
[0mgyp ERR! node-gyp -v v5.1.0[0m
[0mgyp ERR! not ok [0m
[0mnpm WARN S3Trigger71b5b76d@2.0.0 No repository field.[0m
Running amplify push
from my windows box packages up the lambda and deploys it working totally fine, the problem is only when it pulls from github and tries to run through the amplify build platform. I am running node v 16
Thanks for any ideas! My google-foo is failing me this time.