Yarn 安装失败,并出现 304 Not Modified in AWS Amplify Build Pipeline

问题描述 投票:0回答:1

我遇到了一个问题,即在纱线安装步骤期间,AWS Amplify 中的构建过程失败。详情如下:


构建日志输出:

2024-12-17T13:07:25.673Z [WARNING]: error An unexpected error occurred: 
"https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz: Request failed \"304 Not Modified\"".

2024-12-17T13:07:25.677Z [INFO]: info If you think this is a bug, please open a bug report 
with the information provided in "yarn-error.log".

环境详情:

  • AWS Amplify 托管
  • 使用的包管理器命令:yarn install --frozen-lockfile
  1. 清除 Yarn 缓存:在 amplify.yml 文件中添加 --no-cache 标志:
    yarn install --frozen-lockfile --no-cache
  2. 在 Amplify 构建中清除 Yarn 缓存:
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn cache clean
        - yarn install --frozen-lockfile
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - .next/cache/**/*
      - node_modules/**/*
amazon-web-services next.js aws-amplify
1个回答
1
投票

现在我面临着同样的问题,我无法找到任何解决方案。其实这个问题今天突然发生,没有什么大的变化。

© www.soinside.com 2019 - 2024. All rights reserved.