title: Something went wrong installing the \"sharp\" on aws Lambda
body: <p>I am trying to upload function with an image cropper dependency as an aws lambda. It works perfectly on my local machine(<code>node v14.17.3</code>), but fails with the following error when triggering it as a lambda fn.</p>
  <pre><code>&quot;errorType&quot;:
  &quot;Error&quot;
  &quot;errorMessage&quot;:
  &quot;\nSomething went wrong installing the \&quot;sharp\&quot; module\n\nCannot find module '../build/Release/sharp-linux-x64.node'\nRequire stack:\n- /var/task/node_modules/sharp/lib/sharp.js\n- /var/task/node_modules/sharp/lib/constructor.js\n- /var/task/node_modules/sharp/lib/index.js\n- /var/task/index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js\n\nPossible solutions:\n- Install with the --verbose flag and look for errors: \&quot;npm install --ignore-scripts=false --verbose sharp\&quot;\n- Install for the current runtime: \&quot;npm install --platform=linux --arch=x64 sharp\&quot;\n- Consult the installation documentation: https://sharp.pixelplumbing.com/install&quot;
  &quot;stack&quot;:
  &quot;Error: &quot;
  &quot;Something went wrong installing the \&quot;sharp\&quot; module&quot;
  &quot;&quot;
  &quot;Cannot find module '../build/Release/sharp-linux-x64.node'&quot;
  &quot;Require stack:&quot;
  &quot;- /var/task/node_modules/sharp/lib/sharp.js&quot;
  &quot;- /var/task/node_modules/sharp/lib/constructor.js&quot;
  &quot;- /var/task/node_modules/sharp/lib/index.js&quot;
  &quot;- /var/task/index.js&quot;
  &quot;- /var/runtime/UserFunction.js&quot;
  &quot;- /var/runtime/index.js&quot;
  &quot;&quot;
  &quot;Possible solutions:&quot;
  &quot;- Install with the --verbose flag and look for errors: \&quot;npm install --ignore-scripts=false --verbose sharp\&quot;&quot;
  &quot;- Install for the current runtime: \&quot;npm install --platform=linux --arch=x64 sharp\&quot;&quot;
  &quot;- Consult the installation documentation: https://sharp.pixelplumbing.com/install&quot;
  &quot;    at Object.&lt;anonymous&gt; (/var/task/node_modules/sharp/lib/sharp.js:30:9)&quot;
  &quot;    at Module._compile (internal/modules/cjs/loader.js:1085:14)&quot;
  &quot;  
  </code></pre>
  <p>The js file name is index.js and I have zipped all the files below. All the file permissions are as follows:</p>
  <pre><code>-rw-r--r--   1 *****  staff     1379 Dec 26 12:22 index.js
  -rw-r--r--   1 *****  staff      280 Dec 26 12:59 package.json
  drwxr-xr-x   6 *****  staff      192 Dec 26 13:08 ..
  -rw-r--r--   1 *****  staff    44154 Dec 26 13:31 package-lock.json
  drwxr-xr-x  69 *****  staff     2208 Dec 26 13:31 node_modules
  </code></pre>
  <p>I am not sure how to debug this issue as per the suggestions suggested by the error as the image cropper works fine on my local machine. The image cropper version is:</p>
  <pre><code>&quot;node_modules/sharp&quot;: {
    &quot;version&quot;: &quot;0.29.3&quot;,
    &quot;resolved&quot;: &quot;https://registry.npmjs.org/sharp/-/sharp-0.29.3.tgz&quot;,
  ....
  </code></pre>
  <p>Any suggestions where am I going wrong?</p>