1

我在临时网站上推送了 Vue.js 应用程序。

当我使用本地后端运行应用程序时,一切正常。我可以使用Sharp模块裁剪图像,它们被保存到AWS S3存储桶并正确显示。

但是,一旦我尝试使用claudia update将服务器部署到 AWS Lambda ,它就无法在实时站点上运行。我认为这是因为节点模块安装得很干净,并且由于某种原因 AWS 找不到该模块(即使我可以在本地机器上下载它)。

有谁知道我该如何解决这个问题?先感谢您!

{
    "errorType": "Error",
    "errorMessage": "\nSomething went wrong installing the \"sharp\" module\n\nCannot find module '../build/Release/sharp-linux-x64.node'\n\nPossible solutions:\n- Install with the --verbose flag and look for errors: \"npm install --ignore-scripts=false --verbose sharp\"\n- Install for the current runtime: \"npm install --platform=linux --arch=x64 sharp\"\n- Consult the installation documentation: https://sharp.pixelplumbing.com/install",
    "stack": [
        "Error: ",
        "Something went wrong installing the \"sharp\" module",
        "",
        "Cannot find module '../build/Release/sharp-linux-x64.node'",
        "",
        "Possible solutions:",
        "- Install with the --verbose flag and look for errors: \"npm install --ignore-scripts=false --verbose sharp\"",
        "- Install for the current runtime: \"npm install --platform=linux --arch=x64 sharp\"",
        "- Consult the installation documentation: https://sharp.pixelplumbing.com/install",
        "    at Object.<anonymous> (/var/task/node_modules/sharp/lib/sharp.js:30:9)",
        "    at Module._compile (internal/modules/cjs/loader.js:778:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
        "    at Module.load (internal/modules/cjs/loader.js:653:32)",
        "    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
        "    at Module.require (internal/modules/cjs/loader.js:692:17)",
        "    at require (internal/modules/cjs/helpers.js:25:18)",
        "    at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:8:1)",
        "    at Module._compile (internal/modules/cjs/loader.js:778:30)"
    ]
}
4

1 回答 1

-2

安装锐器时使用:

npm install --platform=linux --arch=x64 sharp

代替:

npm install sharp
于 2022-01-07T10:00:32.723 回答