首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试在aws amplify上部署react应用程序,但不断收到"Base Directory not specified for artifacts,unable to create build artifacts“。

尝试在aws amplify上部署react应用程序,但不断收到"Base Directory not specified for artifacts,unable to create build artifacts“。
EN

Stack Overflow用户
提问于 2021-10-03 21:29:42
回答 1查看 205关注 0票数 0

我的react应用程序没有通过构建部分。我能够纠正前面的一些错误,但我被这个错误卡住了:2021-10-03T20:15:39.408Z [ERROR]: !!! CustomerError: Base Directory not specified for artifacts, unable to create build artifact..

Error

这是我的构建设置,即amplify.yml文件。有人知道我如何修复这个错误吗?

代码语言:javascript
复制
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/**/*
EN

回答 1

Stack Overflow用户

发布于 2021-10-19 03:27:39

发生这种情况的原因是没有包含baseDirectoryfileshttps://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.artifactsartifacts的条目。

代码语言:javascript
复制
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - node -v
        - npm run-script build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69429033

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档