Question: When attempting to run sharp inside an AWS Lambda function, I keep getting the following error:

> 
> darwin-x64' binaries cannot be used on the 'linux-x64' platform.
>  Please remove the 'node\_modules/sharp/vendor' directory and run 'npm
>  install'
> 
> 
> 

I deploy my serverless applications with Serverless Framework from my MacBook Pro. How do I fix this problem?

Answer: 
I was facing the same issue, when i do `npm install --arch=x64 --platform=linux sharp` in CMD in windows machine.

Fixed it by opening the CMD in Administrator mode, i did not find any error in running `npm install --arch=x64 --platform=linux sharp`
If you use SAM you could build your function inside an AWS Lambda-like Linux Docker container:

```
sam build -u

```