我把我的反应项目推到了,AWS用git放大了。由于SEO的原因,我安装了react snap软件包。当检查扩增控制台时,显示提供步骤成功,但构建步骤失败了。错误日志显示如下:

一些关于github的旧文章描述了我所遇到的相同问题:https://github.com/thinkJin6/BokuNews/issues/64
我尝试了几种方法,如添加和配置amplify.yml文件以及配置package.json,如下所述:

。https://github.com/puppeteer/puppeteer/issues/765
最后,我尝试了这个链接中的一些内容:https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-aws-ec2-instance-running-amazon-linux
我启用了像这样的amazon临时附加程序,sudo amazon附加程序安装了epel -y,并安装了像这样的Chromium,sudo安装了-y -y.I,使用了AWS CloudShell,但是错误日志消息保持不变。
发布于 2022-09-05 16:52:40
我最近遇到了同样的问题,在一位同事的帮助下,在这里找到了解决方案:链接
我将以下内容添加到我的package.json中
"reactSnap": {
"puppeteerArgs": [
"--no-sandbox",
"--disable-setuid-sandbox"
],
"puppeteerExecutablePath": "/opt/google/chrome/google-chrome"
}然后,我在in中更新了amplify.yml,放大了如下的构建设置
version: 1
frontend:
phases:
preBuild:
commands:
- '# This installs Chrome on any RHEL/CentOS/Amazon Linux variant.'
- curl https://intoli.com/install-google-chrome.sh | bash
- npm i
build:
commands:
- npm run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*https://stackoverflow.com/questions/70125507
复制相似问题