在AWS Lambda中使用Sharp模块时发生错误

问题描述

我正在使用Sharp模块调整图像大小的AWS上部署一个lambda。

尽管使用linux部署以下错误,但仍会发生:

“安装锋利的模块时出错,

Module parse Failed: Unexpected character 'u007f' (1: 0),You may need an appropriate loader to handle this file type,currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders,(Source code omitted for this binary file),"

在我的研究中,我发现问题与操作系统有关。必须使用“ npm install --arch = x64 --platform = linux sharp”来安装Sharp。 但是,问题继续发生。

即使使用linux x84_64,也会发生此问题,有人知道它可能是什么吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)