当出现AWS Lambda中NODE_MODULE_VERSION错误时,可以参考以下快速参考表
有时会遇到这样的错误。
Something went wrong installing the "sharp" module
The module '/opt/nodejs/node_modules/sharp/build/Release/sharp.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
- Ensure the version of Node.js used at install time matches that used at runtime
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues
在哪里可以查看NODE_MODULE_VERSION?
您可以在这里确认。
https://nodejs.org/ja/download/releases/
在AWS Lambda的情况下
每个都将在以下运行时间内完成。
-
- NODE_MODULE_VERSION 57: nodejs8.10
-
- NODE_MODULE_VERSION 64: nodejs10.x
- NODE_MODULE_VERSION 72: nodejs12.x