2024-01-15T09:15:25.547Z undefined ERROR Uncaught Exception {"errorType":"Error","errorMessage":"Could not load the \"sharp\" module using the linux-x64 runtime
Possible solutions:
- Please upgrade Node.js:
Found 16.20.2
Requires ^18.17.0 || ^20.3.0 || >=21.0.0
- Consult the installation documentation:
See https://sharp.pixelplumbing.com/install","stack":["Error: Could not load the \"sharp\" module using the linux-x64 runtime","Possible solutions:","- Please upgrade Node.js:"," Found 16.20.2"," Requires ^18.17.0 || ^20.3.0 || >=21.0.0","- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"," at Object.<anonymous> (/var/task/node_modules/sharp/lib/sharp.js:114:9)"," at Module._compile (node:internal/modules/cjs/loader:1198:14)"," at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)"," at Module.load (node:internal/modules/cjs/loader:1076:32)"," at Function.Module._load (node:internal/modules/cjs/loader:911:12)"," at Module.require (node:internal/modules/cjs/loader:1100:19)"," at require (node:internal/modules/cjs/helpers:119:18)"," at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:10:1)"," at Module._compile (node:internal/modules/cjs/loader:1198:14)"," at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)"]}
After I upgrade runtime: lambda.Runtime.NODEJS_16_X, to runtime:lambda.Runtime.NODEJS_16_X, I got the following error. And NODEJS_20 seems not defined by cdk. likely due to this issue not closed? https://github.com/aws/aws-cdk/issues/27003
2024-01-15T09:24:43.647Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'aws-sdk'
Require stack:
- /var/task/index.js
- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'","Require stack:","- /var/task/index.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1087:17)"," at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)"," at async start (file:///var/runtime/index.mjs:1282:23)"," at async file:///var/runtime/index.mjs:1288:1"]}
I also tried to use node-16 locally, but it does not work with cdk,
Is it possible for the repo to get an upgrade of major depedencies?
After I upgrade
runtime: lambda.Runtime.NODEJS_16_X,
toruntime:lambda.Runtime.NODEJS_16_X,
I got the following error. And NODEJS_20 seems not defined by cdk. likely due to this issue not closed? https://github.com/aws/aws-cdk/issues/27003I also tried to use node-16 locally, but it does not work with cdk,![Screenshot 2024-01-15 at 5 50 04 PM](https://github.com/aws-samples/image-optimization/assets/132834/c4d6061f-97a7-4d1c-9522-4cf3f22fbd9e)
Is it possible for the repo to get an upgrade of major depedencies?