node.js - 在 AWS lambda 中使用 Sharp 模块时出错
问题描述
我在 AWS 上部署了一个 lambda,它使用 Sharp 模块来调整图像大小。
尽管使用 linux 部署,还是会发生以下错误:
“安装sharp模块出了点问题,
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 也会出现这个问题,有谁知道它可能是什么?
解决方案
推荐阅读
- r - R中pcpr2包中的Datamatrix格式问题
- python - 关于 Euler 项目 8. 问题我在哪里做错了?
- laravel-8 - Laravel 加强两因素身份验证
- google-bigquery - 基于日期/时间字段的分区的分区到期倒计时
- java - 我的导航抽屉不会用(recyclerview、tablayout 和 viewpager inside fragment)打开个人资料片段
- python - python中a=b=class_name(value)和a=class_name(value) b=class_name(value)的区别[不重复]
- amazon-web-services - Amazon SP-API 获取所有订单的送货地址
- node.js - Prometheus 和 Grafana 会不会是用于请求记录、跟踪和分析的错误工具?
- mysql - 如何使用==>'设置mysql数据库创建密码
- tableau-api - 具有 2 个选项的 Tableau 参数