简体   繁体   English

尝试在 aws amplify 上部署 react 应用程序,但不断收到“未为工件指定的基本目录,无法创建构建工件”。

[英]Trying to deploy react app on aws amplify but keep getting a "Base Directory not specified for artifacts, unable to create build artifact."

My react app is not making it past the build section.我的 React 应用程序没有通过构建部分。 I was able to some some of the previous errors, but I am stuck on this one: 2021-10-03T20:15:39.408Z [ERROR]: !!! CustomerError: Base Directory not specified for artifacts, unable to create build artifact..我能够解决一些以前的错误,但我坚持这个错误: 2021-10-03T20:15:39.408Z [ERROR]: !!! CustomerError: Base Directory not specified for artifacts, unable to create build artifact.. 2021-10-03T20:15:39.408Z [ERROR]: !!! CustomerError: Base Directory not specified for artifacts, unable to create build artifact..

Error错误

This are my build settings, the amplify.yml file.这是我的构建设置,即 amplify.yml 文件。 Does anyone know how I can fix this error?有谁知道我该如何解决这个错误?

version: 1
backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - node -v
        - npm run-script build
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

This happens cause there is no entry for artifacts , which holds baseDirectory and files , https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.artifacts .发生这种情况是因为没有artifacts条目,它包含baseDirectoryfileshttps: baseDirectory

frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - node -v
        - npm run-script build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React App 无法在 AWS Amplify 上部署 - React App unable to deploy on AWS Amplify AWS Amplify React App Deploy 错误 - 重定向或 AWS 构建设置过多 - AWS Amplify React App Deploy Error- Too many redirect or AWS Build Settings AWS Amplify Deploy(构建和测试)React JS + Jest + Enzyme - AWS Amplify Deploy (Build & Test) React JS + Jest + Enzyme 如何将带有 nextjs 的 React 应用程序成功部署到 AWS Amplify? - how to deploy successfully React app with nextjs to AWS Amplify? 如何在 AWS Amplify 上调试 create-react-app - How do I debug a create-react-app on AWS Amplify Heroku Create React app deploy no such directory - Heroku Create React app deploy no such directory 使用 AWS Amplify Hosting 保留查询字符串 - React - Keep query strings with AWS Amplify Hosting - React 无法在 AWS amplify 上部署 Next Js SSR 应用程序。 (网站内部错误和部署在 cli 上失败) - Unable to Deploy Next Js SSR app on AWS amplify. ( Internal error on Website and Deployment failed on cli) 在 AWS Amplify 上构建 React 应用程序在 Amplify 控制台中失败 - Build of React application on AWS Amplify fails in Amplify Console npx amplify-app@latest 创建 Base Amplify 项目失败 - npx amplify-app@latest failed to create a Base Amplify Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM