When I invoke any function in my serverless application I get an error as below. However, directly installing sharp give me no errors. also, when I run the tests sharp works perfectly.
Missing module": /build/Release/sharp-darwin-x64.node" exists in the node modules
Error:
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp-darwin-x64.node'
Require stack:
- /.esbuild/.build/src/functions/function1/handler.js
System:
- serverless offline
- node12 (x64)
- m1 chip (arm64)
- Serverless esbuild plugin used
solutions tried:
- delete and reinstall node modules
- install vips with brew
- https://github.com/lovell/sharp/issues/2460#issuecomment-739110356
- https://github.com/lovell/sharp/issues/2588#issuecomment-783254806