简体   繁体   English

在 AWS Amplify 上构建 React 应用程序在 Amplify 控制台中失败

[英]Build of React application on AWS Amplify fails in Amplify Console

I can locally publish my application to the S3 bucket and the application works.我可以在本地将我的应用程序发布到 S3 存储桶并且该应用程序可以运行。 But deployment through AWS Amplify console (web) fails on the Build step of the backend.但是通过 AWS Amplify 控制台 (web) 的部署在后端的构建步骤失败。

The build step of the backend fails because of a missing configuration file or directory.由于缺少配置文件或目录,后端的构建步骤失败。

{
  Error: ENOENT: no such file or directory, scandir '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
      at Object.fs.readdirSync (fs.js:904:18)
      at getCfnFiles (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:337:20)
      at updateS3Templates (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:350:39)
      at packageResources.then.then.then.then (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:42:17)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:229:7)
    errno: -2,
    code: 'ENOENT',
    syscall: 'scandir',
    path: '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
}

Anybody has tips how to debug/resolve this problem?有人有如何调试/解决此问题的提示吗?

See my reply on the thread above.请参阅我在上面的线程中的回复。 The directory was not included in my git repo.该目录未包含在我的 git 存储库中。

It's sad that aws amplify is not showing any details on build failure even on debug mode.令人遗憾的是,即使在调试模式下,aws amplify 也没有显示有关构建失败的任何详细信息。

The solution is recloning the app and test locally and then push the changes.解决方案是重新克隆应用程序并在本地进行测试,然后推送更改。

The problem happens to be Git is missing changes.问题恰好是 Git 缺少更改。 This git issue is resolved by following this steps此 git 问题已通过以下步骤解决

在此处输入图像描述

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM