sharp: AWS Lambda, serverless, invalid ELF header

Hi guys. I know you’ve seen a lot of these AWS Lambda installation issues. I’ve read the through the others and attempted what I understood and could. I have a barebones serverless framework project setup with a hello world lambda and I get this response from it

{
  "errorType": "Error",
  "errorMessage": "\nSomething went wrong installing the \"sharp\" module\n\n/var/task/node_modules/sharp/build/Release/../../vendor/lib/libvips-cpp.so.42: invalid ELF header\n\n- Ensure \"linux\" is used at install time as well as runtime\n- Consult the installation documentation at https://sharp.pixelplumbing.com/install\n- Search for this error at https://github.com/lovell/sharp/issues\n",
  "trace": [
    "Error: ",
    "Something went wrong installing the \"sharp\" module",
    "",
    "/var/task/node_modules/sharp/build/Release/../../vendor/lib/libvips-cpp.so.42: invalid ELF header",
    "",
    "- Ensure \"linux\" is used at install time as well as runtime",
    "- Consult the installation documentation at https://sharp.pixelplumbing.com/install",
    "- Search for this error at https://github.com/lovell/sharp/issues",
    "",
    "    at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:34:9)",
    "    at Module._compile (internal/modules/cjs/loader.js:1156:30)",
    "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)",
    "    at Module.load (internal/modules/cjs/loader.js:1000:32)",
    "    at Function.Module._load (internal/modules/cjs/loader.js:899:14)",
    "    at Module.require (internal/modules/cjs/loader.js:1042:19)",
    "    at require (internal/modules/cjs/helpers.js:77:18)",
    "    at Object.<anonymous> (/var/task/node_modules/sharp/lib/index.js:3:15)",
    "    at Module._compile (internal/modules/cjs/loader.js:1156:30)",
    "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)"
  ]
}

I’ve read the AWS section on installation and used many variations of the following docker command since I’m on win10. I’ve tried adding --platform=linux and --arch=x64. I have removed the node_module folder entirely before running docker. I removed node_modules/sharp specifically too. Tried with and without --unsafe-perm. Nothing changes. My Lambda runtime is NodeJs 12.x. Running node --version in the docker image gives me 12.16.1. What am I doing wrong?? More info below. Thank you!

Node running on my host win10 machine is version 12.6.3… could that be an issue?

$ docker run --rm -v //z/bk/wd/ImageHandler/sharpTest:/var/task lambci/lambda:build-nodejs12.x npm install sharp --verbose --unsafe-perm
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/var/lang/bin/node',
npm verb cli   '/var/lang/bin/npm',
npm verb cli   'install',
npm verb cli   'sharp',
npm verb cli   '--verbose',
npm verb cli   '--unsafe-perm'
npm verb cli ]
npm info using npm@6.13.4
npm info using node@v12.16.1
npm verb npm-session d74ba38639f6a65b
npm http fetch GET 200 https://registry.npmjs.org/sharp 196ms
npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.25.2.tgz 70ms
npm timing stage:loadCurrentTree Completed in 298ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
npm http fetch GET 200 https://registry.npmjs.org/color 70ms
npm http fetch GET 200 https://registry.npmjs.org/color/-/color-3.1.2.tgz 51ms
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 144ms
npm http fetch GET 200 https://registry.npmjs.org/semver 163ms
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 170ms
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 187ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get 183ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 191ms
npm http fetch GET 200 https://registry.npmjs.org/npmlog 195ms
npm http fetch GET 200 https://registry.npmjs.org/tar 193ms
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz 59ms
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-7.3.2.tgz 61ms
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz 62ms
npm http fetch GET 200 https://registry.npmjs.org/tar/-/tar-6.0.2.tgz 76ms
npm http fetch GET 200 https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz 80ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz 86ms
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz 107ms
npm http fetch GET 200 https://registry.npmjs.org/color-convert 49ms
npm http fetch GET 200 https://registry.npmjs.org/color-string 55ms
npm http fetch GET 200 https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz 62ms
npm http fetch GET 200 https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz 74ms
npm http fetch GET 200 https://registry.npmjs.org/color-name 64ms
npm http fetch GET 200 https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz 59ms
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 53ms
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz 61ms
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 56ms
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz 48ms
npm http fetch GET 200 https://registry.npmjs.org/gauge 61ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 64ms
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 66ms
npm http fetch GET 200 https://registry.npmjs.org/set-blocking 66ms
npm http fetch GET 200 https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz 52ms
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz 51ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz 59ms
npm http fetch GET 200 https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz 58ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream 51ms
npm http fetch GET 200 https://registry.npmjs.org/delegates 53ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz 52ms
npm http fetch GET 200 https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz 58ms
npm http fetch GET 200 https://registry.npmjs.org/inherits 50ms
npm http fetch GET 200 https://registry.npmjs.org/core-util-is 51ms
npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args 58ms
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 61ms
npm http fetch GET 200 https://registry.npmjs.org/string_decoder 64ms
npm http fetch GET 200 https://registry.npmjs.org/isarray 71ms
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 74ms
npm http fetch GET 200 https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz 47ms
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz 54ms
npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz 58ms
npm http fetch GET 200 https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz 61ms
npm http fetch GET 200 https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz 58ms
npm http fetch GET 200 https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz 257ms
npm http fetch GET 200 https://registry.npmjs.org/wide-align 61ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 62ms
npm http fetch GET 200 https://registry.npmjs.org/has-unicode 69ms
npm http fetch GET 200 https://registry.npmjs.org/string-width 70ms
npm http fetch GET 200 https://registry.npmjs.org/aproba 71ms
npm http fetch GET 200 https://registry.npmjs.org/signal-exit 74ms
npm http fetch GET 200 https://registry.npmjs.org/object-assign 75ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz 50ms
npm http fetch GET 200 https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz 78ms
npm http fetch GET 200 https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz 69ms
npm http fetch GET 200 https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz 73ms
npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz 71ms
npm http fetch GET 200 https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz 68ms
npm http fetch GET 200 https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz 68ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at 48ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 58ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz 55ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz 53ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan 56ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz 48ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 47ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz 53ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 59ms
npm http fetch GET 200 https://registry.npmjs.org/noop-logger 61ms
npm http fetch GET 200 https://registry.npmjs.org/rc 66ms
npm http fetch GET 200 https://registry.npmjs.org/node-abi 73ms
npm http fetch GET 200 https://registry.npmjs.org/pump 75ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp 76ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 76ms
npm http fetch GET 200 https://registry.npmjs.org/expand-template 79ms
npm http fetch GET 200 https://registry.npmjs.org/minimist 82ms
npm http fetch GET 200 https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz 55ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 57ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz 53ms
npm http fetch GET 200 https://registry.npmjs.org/pump/-/pump-3.0.0.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz 63ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz 68ms
npm http fetch GET 200 https://registry.npmjs.org/node-abi/-/node-abi-2.16.0.tgz 72ms
npm http fetch GET 200 https://registry.npmjs.org/rc/-/rc-1.2.8.tgz 81ms
npm http fetch GET 200 https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz 68ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 154ms
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs 51ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz 50ms
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz 57ms
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-5.7.1.tgz 50ms
npm http fetch GET 200 https://registry.npmjs.org/once 48ms
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 58ms
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/once/-/once-1.4.0.tgz 68ms
npm http fetch GET 200 https://registry.npmjs.org/wrappy 67ms
npm http fetch GET 200 https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz 48ms
npm http fetch GET 200 https://registry.npmjs.org/ini 56ms
npm http fetch GET 200 https://registry.npmjs.org/deep-extend 57ms
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 59ms
npm http fetch GET 200 https://registry.npmjs.org/ini/-/ini-1.3.5.tgz 48ms
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz 51ms
npm http fetch GET 200 https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz 81ms
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 47ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response 55ms
npm http fetch GET 200 https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response 50ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz 52ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 52ms
npm http fetch GET 200 https://registry.npmjs.org/chownr 65ms
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 66ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz 54ms
npm http fetch GET 200 https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz 49ms
npm http fetch GET 200 https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz 71ms
npm http fetch GET 200 https://registry.npmjs.org/bl 61ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz 60ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants 63ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz 47ms
npm http fetch GET 200 https://registry.npmjs.org/bl/-/bl-4.0.2.tgz 53ms
npm http fetch GET 200 https://registry.npmjs.org/buffer 70ms
npm http fetch GET 200 https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz 69ms
npm http fetch GET 200 https://registry.npmjs.org/ieee754 48ms
npm http fetch GET 200 https://registry.npmjs.org/base64-js 54ms
npm http fetch GET 200 https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz 61ms
npm http fetch GET 200 https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz 55ms
npm http fetch GET 200 https://registry.npmjs.org/yallist 73ms
npm http fetch GET 200 https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz 80ms
npm http fetch GET 200 https://registry.npmjs.org/fs-minipass 84ms
npm http fetch GET 200 https://registry.npmjs.org/minizlib 84ms
npm http fetch GET 200 https://registry.npmjs.org/minipass 86ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz 92ms
npm http fetch GET 200 https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz 48ms
npm http fetch GET 200 https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz 56ms
npm http fetch GET 200 https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz 57ms
npm http fetch GET 200 https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz 54ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 3423ms
npm timing stage:loadIdealTree Completed in 3444ms
npm timing stage:generateActionsToTake Completed in 32ms
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /root/.npm/_locks/staging-1313e7c4addbfc02.lock for /var/task/node_modules/.staging
npm timing audit submit Completed in 327ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 327ms
npm timing audit body Completed in 0ms
npm timing action:extract Completed in 3115ms
npm timing action:finalize Completed in 404ms
npm timing action:refresh-package-json Completed in 701ms
npm info lifecycle ansi-regex@2.1.1~preinstall: ansi-regex@2.1.1
npm info lifecycle aproba@1.2.0~preinstall: aproba@1.2.0
npm info lifecycle base64-js@1.3.1~preinstall: base64-js@1.3.1
npm info lifecycle chownr@1.1.4~preinstall: chownr@1.1.4
npm info lifecycle code-point-at@1.1.0~preinstall: code-point-at@1.1.0
npm info lifecycle color-name@1.1.3~preinstall: color-name@1.1.3
npm info lifecycle color-convert@1.9.3~preinstall: color-convert@1.9.3
npm info lifecycle console-control-strings@1.1.0~preinstall: console-control-strings@1.1.0
npm info lifecycle core-util-is@1.0.2~preinstall: core-util-is@1.0.2
npm info lifecycle deep-extend@0.6.0~preinstall: deep-extend@0.6.0
npm info lifecycle delegates@1.0.0~preinstall: delegates@1.0.0
npm info lifecycle detect-libc@1.0.3~preinstall: detect-libc@1.0.3
npm info lifecycle expand-template@2.0.3~preinstall: expand-template@2.0.3
npm info lifecycle fs-constants@1.0.0~preinstall: fs-constants@1.0.0
npm info lifecycle github-from-package@0.0.0~preinstall: github-from-package@0.0.0
npm info lifecycle has-unicode@2.0.1~preinstall: has-unicode@2.0.1
npm info lifecycle ieee754@1.1.13~preinstall: ieee754@1.1.13
npm info lifecycle buffer@5.6.0~preinstall: buffer@5.6.0
npm info lifecycle inherits@2.0.4~preinstall: inherits@2.0.4
npm info lifecycle ini@1.3.5~preinstall: ini@1.3.5
npm info lifecycle is-arrayish@0.3.2~preinstall: is-arrayish@0.3.2
npm info lifecycle isarray@1.0.0~preinstall: isarray@1.0.0
npm info lifecycle mimic-response@2.1.0~preinstall: mimic-response@2.1.0
npm info lifecycle decompress-response@4.2.1~preinstall: decompress-response@4.2.1
npm info lifecycle minimist@1.2.5~preinstall: minimist@1.2.5
npm info lifecycle mkdirp@0.5.5~preinstall: mkdirp@0.5.5
npm info lifecycle mkdirp-classic@0.5.3~preinstall: mkdirp-classic@0.5.3
npm info lifecycle napi-build-utils@1.0.2~preinstall: napi-build-utils@1.0.2
npm info lifecycle semver@5.7.1~preinstall: semver@5.7.1
npm info lifecycle node-abi@2.16.0~preinstall: node-abi@2.16.0
npm info lifecycle noop-logger@0.1.1~preinstall: noop-logger@0.1.1
npm info lifecycle number-is-nan@1.0.1~preinstall: number-is-nan@1.0.1
npm info lifecycle is-fullwidth-code-point@1.0.0~preinstall: is-fullwidth-code-point@1.0.0
npm info lifecycle object-assign@4.1.1~preinstall: object-assign@4.1.1
npm info lifecycle process-nextick-args@2.0.1~preinstall: process-nextick-args@2.0.1
npm info lifecycle safe-buffer@5.1.2~preinstall: safe-buffer@5.1.2
npm info lifecycle set-blocking@2.0.0~preinstall: set-blocking@2.0.0
npm info lifecycle signal-exit@3.0.3~preinstall: signal-exit@3.0.3
npm info lifecycle simple-concat@1.0.0~preinstall: simple-concat@1.0.0
npm info lifecycle simple-swizzle@0.2.2~preinstall: simple-swizzle@0.2.2
npm info lifecycle color-string@1.5.3~preinstall: color-string@1.5.3
npm info lifecycle string_decoder@1.1.1~preinstall: string_decoder@1.1.1
npm info lifecycle strip-ansi@3.0.1~preinstall: strip-ansi@3.0.1
npm info lifecycle string-width@1.0.2~preinstall: string-width@1.0.2
npm info lifecycle strip-json-comments@2.0.1~preinstall: strip-json-comments@2.0.1
npm info lifecycle rc@1.2.8~preinstall: rc@1.2.8
npm info lifecycle chownr@2.0.0~preinstall: chownr@2.0.0
npm info lifecycle mkdirp@1.0.4~preinstall: mkdirp@1.0.4
npm info lifecycle tunnel-agent@0.6.0~preinstall: tunnel-agent@0.6.0
npm info lifecycle util-deprecate@1.0.2~preinstall: util-deprecate@1.0.2
npm info lifecycle sharp@0.25.2~preinstall: sharp@0.25.2
npm info lifecycle tar@6.0.2~preinstall: tar@6.0.2
npm info lifecycle semver@7.3.2~preinstall: semver@7.3.2
npm info lifecycle prebuild-install@5.3.3~preinstall: prebuild-install@5.3.3
npm info lifecycle node-addon-api@2.0.0~preinstall: node-addon-api@2.0.0
npm info lifecycle color@3.1.2~preinstall: color@3.1.2
npm info lifecycle minizlib@2.1.0~preinstall: minizlib@2.1.0
npm info lifecycle fs-minipass@2.1.0~preinstall: fs-minipass@2.1.0
npm info lifecycle minipass@3.1.1~preinstall: minipass@3.1.1
npm info lifecycle yallist@4.0.0~preinstall: yallist@4.0.0
npm info lifecycle simple-get@3.1.0~preinstall: simple-get@3.1.0
npm info lifecycle tar-fs@2.0.1~preinstall: tar-fs@2.0.1
npm info lifecycle pump@3.0.0~preinstall: pump@3.0.0
npm info lifecycle tar-stream@2.1.2~preinstall: tar-stream@2.1.2
npm info lifecycle end-of-stream@1.4.4~preinstall: end-of-stream@1.4.4
npm info lifecycle once@1.4.0~preinstall: once@1.4.0
npm info lifecycle wrappy@1.0.2~preinstall: wrappy@1.0.2
npm info lifecycle npmlog@4.1.2~preinstall: npmlog@4.1.2
npm info lifecycle gauge@2.7.4~preinstall: gauge@2.7.4
npm info lifecycle wide-align@1.1.3~preinstall: wide-align@1.1.3
npm info lifecycle which-pm-runs@1.0.0~preinstall: which-pm-runs@1.0.0
npm info lifecycle readable-stream@3.6.0~preinstall: readable-stream@3.6.0
npm info lifecycle are-we-there-yet@1.1.5~preinstall: are-we-there-yet@1.1.5
npm info lifecycle readable-stream@2.3.7~preinstall: readable-stream@2.3.7
npm info lifecycle bl@4.0.2~preinstall: bl@4.0.2
npm info lifecycle readable-stream@3.6.0~preinstall: readable-stream@3.6.0
npm timing action:preinstall Completed in 57ms
npm info linkStuff ansi-regex@2.1.1
npm info linkStuff aproba@1.2.0
npm info linkStuff base64-js@1.3.1
npm info linkStuff chownr@1.1.4
npm info linkStuff code-point-at@1.1.0
npm info linkStuff color-name@1.1.3
npm info linkStuff color-convert@1.9.3
npm info linkStuff console-control-strings@1.1.0
npm info linkStuff core-util-is@1.0.2
npm info linkStuff deep-extend@0.6.0
npm info linkStuff delegates@1.0.0
npm info linkStuff detect-libc@1.0.3
npm verb linkBins [
npm verb linkBins   { 'detect-libc': 'bin/detect-libc.js' },
npm verb linkBins   '/var/task/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff expand-template@2.0.3
npm info linkStuff fs-constants@1.0.0
npm info linkStuff github-from-package@0.0.0
npm info linkStuff has-unicode@2.0.1
npm info linkStuff ieee754@1.1.13
npm info linkStuff buffer@5.6.0
npm info linkStuff inherits@2.0.4
npm info linkStuff ini@1.3.5
npm info linkStuff is-arrayish@0.3.2
npm info linkStuff isarray@1.0.0
npm info linkStuff mimic-response@2.1.0
npm info linkStuff decompress-response@4.2.1
npm info linkStuff minimist@1.2.5
npm info linkStuff mkdirp@0.5.5
npm verb linkBins [ { mkdirp: 'bin/cmd.js' }, '/var/task/node_modules/.bin', false ]
npm info linkStuff mkdirp-classic@0.5.3
npm info linkStuff napi-build-utils@1.0.2
npm info linkStuff semver@5.7.1
npm verb linkBins [
npm verb linkBins   { semver: 'bin/semver' },
npm verb linkBins   '/var/task/node_modules/node-abi/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff node-abi@2.16.0
npm info linkStuff noop-logger@0.1.1
npm info linkStuff number-is-nan@1.0.1
npm info linkStuff is-fullwidth-code-point@1.0.0
npm info linkStuff object-assign@4.1.1
npm info linkStuff process-nextick-args@2.0.1
npm info linkStuff safe-buffer@5.1.2
npm info linkStuff set-blocking@2.0.0
npm info linkStuff signal-exit@3.0.3
npm info linkStuff simple-concat@1.0.0
npm info linkStuff simple-swizzle@0.2.2
npm info linkStuff color-string@1.5.3
npm info linkStuff string_decoder@1.1.1
npm info linkStuff strip-ansi@3.0.1
npm info linkStuff string-width@1.0.2
npm info linkStuff strip-json-comments@2.0.1
npm info linkStuff rc@1.2.8
npm verb linkBins [ { rc: 'cli.js' }, '/var/task/node_modules/.bin', false ]
npm info linkStuff chownr@2.0.0
npm info linkStuff mkdirp@1.0.4
npm verb linkBins [
npm verb linkBins   { mkdirp: 'bin/cmd.js' },
npm verb linkBins   '/var/task/node_modules/tar/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff tunnel-agent@0.6.0
npm info linkStuff util-deprecate@1.0.2
npm info linkStuff readable-stream@3.6.0
npm info linkStuff bl@4.0.2
npm info linkStuff readable-stream@2.3.7
npm info linkStuff are-we-there-yet@1.1.5
npm info linkStuff readable-stream@3.6.0
npm info linkStuff which-pm-runs@1.0.0
npm info linkStuff wide-align@1.1.3
npm info linkStuff gauge@2.7.4
npm info linkStuff npmlog@4.1.2
npm info linkStuff wrappy@1.0.2
npm info linkStuff once@1.4.0
npm info linkStuff end-of-stream@1.4.4
npm info linkStuff tar-stream@2.1.2
npm info linkStuff pump@3.0.0
npm info linkStuff tar-fs@2.0.1
npm info linkStuff simple-get@3.1.0
npm info linkStuff yallist@4.0.0
npm info linkStuff minipass@3.1.1
npm info linkStuff fs-minipass@2.1.0
npm info linkStuff minizlib@2.1.0
npm info linkStuff color@3.1.2
npm info linkStuff node-addon-api@2.0.0
npm info linkStuff prebuild-install@5.3.3
npm verb linkBins [
npm verb linkBins   { 'prebuild-install': 'bin.js' },
npm verb linkBins   '/var/task/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff semver@7.3.2
npm verb linkBins [ { semver: 'bin/semver.js' }, '/var/task/node_modules/.bin', false ]
npm info linkStuff tar@6.0.2
npm info linkStuff sharp@0.25.2
npm timing action:build Completed in 112ms
npm info lifecycle ansi-regex@2.1.1~install: ansi-regex@2.1.1
npm info lifecycle aproba@1.2.0~install: aproba@1.2.0
npm info lifecycle base64-js@1.3.1~install: base64-js@1.3.1
npm info lifecycle chownr@1.1.4~install: chownr@1.1.4
npm info lifecycle code-point-at@1.1.0~install: code-point-at@1.1.0
npm info lifecycle color-name@1.1.3~install: color-name@1.1.3
npm info lifecycle color-convert@1.9.3~install: color-convert@1.9.3
npm info lifecycle console-control-strings@1.1.0~install: console-control-strings@1.1.0
npm info lifecycle core-util-is@1.0.2~install: core-util-is@1.0.2
npm info lifecycle deep-extend@0.6.0~install: deep-extend@0.6.0
npm info lifecycle delegates@1.0.0~install: delegates@1.0.0
npm info lifecycle detect-libc@1.0.3~install: detect-libc@1.0.3
npm info lifecycle expand-template@2.0.3~install: expand-template@2.0.3
npm info lifecycle fs-constants@1.0.0~install: fs-constants@1.0.0
npm info lifecycle github-from-package@0.0.0~install: github-from-package@0.0.0
npm info lifecycle has-unicode@2.0.1~install: has-unicode@2.0.1
npm info lifecycle ieee754@1.1.13~install: ieee754@1.1.13
npm info lifecycle buffer@5.6.0~install: buffer@5.6.0
npm info lifecycle inherits@2.0.4~install: inherits@2.0.4
npm info lifecycle ini@1.3.5~install: ini@1.3.5
npm info lifecycle is-arrayish@0.3.2~install: is-arrayish@0.3.2
npm info lifecycle isarray@1.0.0~install: isarray@1.0.0
npm info lifecycle mimic-response@2.1.0~install: mimic-response@2.1.0
npm info lifecycle decompress-response@4.2.1~install: decompress-response@4.2.1
npm info lifecycle minimist@1.2.5~install: minimist@1.2.5
npm info lifecycle mkdirp@0.5.5~install: mkdirp@0.5.5
npm info lifecycle mkdirp-classic@0.5.3~install: mkdirp-classic@0.5.3
npm info lifecycle napi-build-utils@1.0.2~install: napi-build-utils@1.0.2
npm info lifecycle semver@5.7.1~install: semver@5.7.1
npm info lifecycle node-abi@2.16.0~install: node-abi@2.16.0
npm info lifecycle noop-logger@0.1.1~install: noop-logger@0.1.1
npm info lifecycle number-is-nan@1.0.1~install: number-is-nan@1.0.1
npm info lifecycle is-fullwidth-code-point@1.0.0~install: is-fullwidth-code-point@1.0.0
npm info lifecycle object-assign@4.1.1~install: object-assign@4.1.1
npm info lifecycle process-nextick-args@2.0.1~install: process-nextick-args@2.0.1
npm info lifecycle safe-buffer@5.1.2~install: safe-buffer@5.1.2
npm info lifecycle set-blocking@2.0.0~install: set-blocking@2.0.0
npm info lifecycle signal-exit@3.0.3~install: signal-exit@3.0.3
npm info lifecycle simple-concat@1.0.0~install: simple-concat@1.0.0
npm info lifecycle simple-swizzle@0.2.2~install: simple-swizzle@0.2.2
npm info lifecycle color-string@1.5.3~install: color-string@1.5.3
npm info lifecycle string_decoder@1.1.1~install: string_decoder@1.1.1
npm info lifecycle strip-ansi@3.0.1~install: strip-ansi@3.0.1
npm info lifecycle string-width@1.0.2~install: string-width@1.0.2
npm info lifecycle strip-json-comments@2.0.1~install: strip-json-comments@2.0.1
npm info lifecycle rc@1.2.8~install: rc@1.2.8
npm info lifecycle chownr@2.0.0~install: chownr@2.0.0
npm info lifecycle mkdirp@1.0.4~install: mkdirp@1.0.4
npm info lifecycle tunnel-agent@0.6.0~install: tunnel-agent@0.6.0
npm info lifecycle util-deprecate@1.0.2~install: util-deprecate@1.0.2
npm info lifecycle readable-stream@3.6.0~install: readable-stream@3.6.0
npm info lifecycle bl@4.0.2~install: bl@4.0.2
npm info lifecycle readable-stream@2.3.7~install: readable-stream@2.3.7
npm info lifecycle are-we-there-yet@1.1.5~install: are-we-there-yet@1.1.5
npm info lifecycle readable-stream@3.6.0~install: readable-stream@3.6.0
npm info lifecycle which-pm-runs@1.0.0~install: which-pm-runs@1.0.0
npm info lifecycle wide-align@1.1.3~install: wide-align@1.1.3
npm info lifecycle gauge@2.7.4~install: gauge@2.7.4
npm info lifecycle npmlog@4.1.2~install: npmlog@4.1.2
npm info lifecycle wrappy@1.0.2~install: wrappy@1.0.2
npm info lifecycle once@1.4.0~install: once@1.4.0
npm info lifecycle end-of-stream@1.4.4~install: end-of-stream@1.4.4
npm info lifecycle tar-stream@2.1.2~install: tar-stream@2.1.2
npm info lifecycle pump@3.0.0~install: pump@3.0.0
npm info lifecycle tar-fs@2.0.1~install: tar-fs@2.0.1
npm info lifecycle simple-get@3.1.0~install: simple-get@3.1.0
npm info lifecycle yallist@4.0.0~install: yallist@4.0.0
npm info lifecycle minipass@3.1.1~install: minipass@3.1.1
npm info lifecycle fs-minipass@2.1.0~install: fs-minipass@2.1.0
npm info lifecycle minizlib@2.1.0~install: minizlib@2.1.0
npm info lifecycle color@3.1.2~install: color@3.1.2
npm info lifecycle node-addon-api@2.0.0~install: node-addon-api@2.0.0
npm info lifecycle prebuild-install@5.3.3~install: prebuild-install@5.3.3
npm info lifecycle semver@7.3.2~install: semver@7.3.2
npm info lifecycle tar@6.0.2~install: tar@6.0.2
npm info lifecycle sharp@0.25.2~install: sharp@0.25.2

> sharp@0.25.2 install /var/task/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ /root/.npm/_prebuilds/ba3ce8-sharp-v0.25.2-napi-v3-linux-x64.tar.gz
prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.25.2/sharp-v0.25.2-napi-v3-linux-x64.tar.gz
prebuild-install http 200 https://github.com/lovell/sharp/releases/download/v0.25.2/sharp-v0.25.2-napi-v3-linux-x64.tar.gz
prebuild-install info downloading to @ /root/.npm/_prebuilds/ba3ce8-sharp-v0.25.2-napi-v3-linux-x64.tar.gz.41-c9b4e02b0e709.tmp
prebuild-install info renaming to @ /root/.npm/_prebuilds/ba3ce8-sharp-v0.25.2-napi-v3-linux-x64.tar.gz
prebuild-install info unpacking @ /root/.npm/_prebuilds/ba3ce8-sharp-v0.25.2-napi-v3-linux-x64.tar.gz
prebuild-install info unpack resolved to /var/task/node_modules/sharp/build/Release/sharp.node
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle sharp@0.25.2~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.25.2~install: PATH: /var/lang/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/task/node_modules/sharp/node_modules/.bin:/var/task/node_modules/.bin:/var/lang/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
npm verb lifecycle sharp@0.25.2~install: CWD: /var/task/node_modules/sharp
npm timing action:install Completed in 9686ms
npm info lifecycle ansi-regex@2.1.1~postinstall: ansi-regex@2.1.1
npm info lifecycle aproba@1.2.0~postinstall: aproba@1.2.0
npm info lifecycle base64-js@1.3.1~postinstall: base64-js@1.3.1
npm info lifecycle chownr@1.1.4~postinstall: chownr@1.1.4
npm info lifecycle code-point-at@1.1.0~postinstall: code-point-at@1.1.0
npm info lifecycle color-name@1.1.3~postinstall: color-name@1.1.3
npm info lifecycle color-convert@1.9.3~postinstall: color-convert@1.9.3
npm info lifecycle console-control-strings@1.1.0~postinstall: console-control-strings@1.1.0
npm info lifecycle core-util-is@1.0.2~postinstall: core-util-is@1.0.2
npm info lifecycle deep-extend@0.6.0~postinstall: deep-extend@0.6.0
npm info lifecycle delegates@1.0.0~postinstall: delegates@1.0.0
npm info lifecycle detect-libc@1.0.3~postinstall: detect-libc@1.0.3
npm info lifecycle expand-template@2.0.3~postinstall: expand-template@2.0.3
npm info lifecycle fs-constants@1.0.0~postinstall: fs-constants@1.0.0
npm info lifecycle github-from-package@0.0.0~postinstall: github-from-package@0.0.0
npm info lifecycle has-unicode@2.0.1~postinstall: has-unicode@2.0.1
npm info lifecycle ieee754@1.1.13~postinstall: ieee754@1.1.13
npm info lifecycle buffer@5.6.0~postinstall: buffer@5.6.0
npm info lifecycle inherits@2.0.4~postinstall: inherits@2.0.4
npm info lifecycle ini@1.3.5~postinstall: ini@1.3.5
npm info lifecycle is-arrayish@0.3.2~postinstall: is-arrayish@0.3.2
npm info lifecycle isarray@1.0.0~postinstall: isarray@1.0.0
npm info lifecycle mimic-response@2.1.0~postinstall: mimic-response@2.1.0
npm info lifecycle decompress-response@4.2.1~postinstall: decompress-response@4.2.1
npm info lifecycle minimist@1.2.5~postinstall: minimist@1.2.5
npm info lifecycle mkdirp@0.5.5~postinstall: mkdirp@0.5.5
npm info lifecycle mkdirp-classic@0.5.3~postinstall: mkdirp-classic@0.5.3
npm info lifecycle napi-build-utils@1.0.2~postinstall: napi-build-utils@1.0.2
npm info lifecycle semver@5.7.1~postinstall: semver@5.7.1
npm info lifecycle node-abi@2.16.0~postinstall: node-abi@2.16.0
npm info lifecycle noop-logger@0.1.1~postinstall: noop-logger@0.1.1
npm info lifecycle number-is-nan@1.0.1~postinstall: number-is-nan@1.0.1
npm info lifecycle is-fullwidth-code-point@1.0.0~postinstall: is-fullwidth-code-point@1.0.0
npm info lifecycle object-assign@4.1.1~postinstall: object-assign@4.1.1
npm info lifecycle process-nextick-args@2.0.1~postinstall: process-nextick-args@2.0.1
npm info lifecycle safe-buffer@5.1.2~postinstall: safe-buffer@5.1.2
npm info lifecycle set-blocking@2.0.0~postinstall: set-blocking@2.0.0
npm info lifecycle signal-exit@3.0.3~postinstall: signal-exit@3.0.3
npm info lifecycle simple-concat@1.0.0~postinstall: simple-concat@1.0.0
npm info lifecycle simple-swizzle@0.2.2~postinstall: simple-swizzle@0.2.2
npm info lifecycle color-string@1.5.3~postinstall: color-string@1.5.3
npm info lifecycle string_decoder@1.1.1~postinstall: string_decoder@1.1.1
npm info lifecycle strip-ansi@3.0.1~postinstall: strip-ansi@3.0.1
npm info lifecycle string-width@1.0.2~postinstall: string-width@1.0.2
npm info lifecycle strip-json-comments@2.0.1~postinstall: strip-json-comments@2.0.1
npm info lifecycle rc@1.2.8~postinstall: rc@1.2.8
npm info lifecycle chownr@2.0.0~postinstall: chownr@2.0.0
npm info lifecycle mkdirp@1.0.4~postinstall: mkdirp@1.0.4
npm info lifecycle tunnel-agent@0.6.0~postinstall: tunnel-agent@0.6.0
npm info lifecycle util-deprecate@1.0.2~postinstall: util-deprecate@1.0.2
npm info lifecycle readable-stream@3.6.0~postinstall: readable-stream@3.6.0
npm info lifecycle bl@4.0.2~postinstall: bl@4.0.2
npm info lifecycle readable-stream@2.3.7~postinstall: readable-stream@2.3.7
npm info lifecycle are-we-there-yet@1.1.5~postinstall: are-we-there-yet@1.1.5
npm info lifecycle readable-stream@3.6.0~postinstall: readable-stream@3.6.0
npm info lifecycle which-pm-runs@1.0.0~postinstall: which-pm-runs@1.0.0
npm info lifecycle wide-align@1.1.3~postinstall: wide-align@1.1.3
npm info lifecycle gauge@2.7.4~postinstall: gauge@2.7.4
npm info lifecycle npmlog@4.1.2~postinstall: npmlog@4.1.2
npm info lifecycle wrappy@1.0.2~postinstall: wrappy@1.0.2
npm info lifecycle once@1.4.0~postinstall: once@1.4.0
npm info lifecycle end-of-stream@1.4.4~postinstall: end-of-stream@1.4.4
npm info lifecycle tar-stream@2.1.2~postinstall: tar-stream@2.1.2
npm info lifecycle pump@3.0.0~postinstall: pump@3.0.0
npm info lifecycle tar-fs@2.0.1~postinstall: tar-fs@2.0.1
npm info lifecycle simple-get@3.1.0~postinstall: simple-get@3.1.0
npm info lifecycle yallist@4.0.0~postinstall: yallist@4.0.0
npm info lifecycle minipass@3.1.1~postinstall: minipass@3.1.1
npm info lifecycle fs-minipass@2.1.0~postinstall: fs-minipass@2.1.0
npm info lifecycle minizlib@2.1.0~postinstall: minizlib@2.1.0
npm info lifecycle color@3.1.2~postinstall: color@3.1.2
npm info lifecycle node-addon-api@2.0.0~postinstall: node-addon-api@2.0.0
npm info lifecycle prebuild-install@5.3.3~postinstall: prebuild-install@5.3.3
npm info lifecycle semver@7.3.2~postinstall: semver@7.3.2
npm info lifecycle tar@6.0.2~postinstall: tar@6.0.2
npm info lifecycle sharp@0.25.2~postinstall: sharp@0.25.2
npm timing action:postinstall Completed in 17ms
npm verb unlock done using /root/.npm/_locks/staging-1313e7c4addbfc02.lock for /var/task/node_modules/.staging
npm timing stage:executeActions Completed in 14116ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 17923ms
npm verb saving [ { name: 'sharp', spec: '^0.25.2', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm notice created a lockfile as package-lock.json. You should commit this file.
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN sharptest@1.0.0 No description
npm WARN sharptest@1.0.0 No repository field.

+ sharp@0.25.2
added 76 packages from 154 contributors and audited 163 packages in 17.991s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 18297ms
npm info ok
$ npm ls sharp
sharptest@1.0.0 Z:\bk\wd\ImageHandler\sharpTest
`-- sharp@0.25.2 
$ npm view sharp dist-tags.latest
0.25.2

$ docker run --rm -v //z/bk/wd/ImageHandler/sharpTest:/var/task lambci/lambda:build-nodejs12.x npx envinfo --binaries --system
npx: installed 1 in 1.049s

  System:
    OS: Linux 4.19 Amazon Linux 2
    CPU: (2) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 445.40 MB / 1.94 GB
    Container: Yes
    Shell: 4.2.46 - /bin/bash
  Binaries:
    Node: 12.16.1 - /var/lang/bin/node
    npm: 6.13.4 - /var/lang/bin/npm

Here is my serverless.yml:

service: sharptest

provider:
  name: aws
  runtime: nodejs12.x

functions:
  hello:
    handler: handler.hello

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Here’s a rough script I threw together to build sharp and package your lambdas. Maybe it’ll help someone. Simply run the script in your project directory and a ready-to-upload zip will appear in the ‘.output’ folder. Name the following script ‘package.bash’ or change the last exclude parameter on the docker command on the last line.

#!/usr/bin/bash

rm -rf node_modules/sharp
docker run --rm -v "/$(pwd -W):/var/task" lambci/lambda:build-nodejs12.x npm install sharp
mkdir .output
rm .output/output.zip
docker run --rm -v "/$(pwd -W):/var/task" lambci/lambda:build-nodejs12.x zip -r --symlinks .output/output.zip . -x '*.git*' -x '*.output*' -x 'package.bash'