5

I upgraded Amplify CLI, but I discovered in my amplify/backend/backend-config.json file has disappeared after taking a day to discovered that. Then I have tried running amplify init again with the options to continue with my existing environment or new environment, and I have tried both but still got the same error

Error: File at path: 'C:\Users\BEN\documents\TinderClone\amplify\backend\backend-config.json' does not exist

What do I do to solve this error (to get the backend-config.json back).

enter image description here

margincall
  • 483
  • 1
  • 6
  • 24
Benjamin Ikwuagwu
  • 377
  • 1
  • 9
  • 28

4 Answers4

5

I was able to solve this by using the amplify pull then navigating to the #current-cloud-backend and copying the file from there to the directory needed.

Sean Faria
  • 51
  • 1
  • 4
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31646728) – patL May 03 '22 at 14:31
  • What do you need to copy from #current-cloud-backend? And what directory would need it? – conor909 Oct 20 '22 at 15:45
  • I spoke with aws support about this that directory is the live environment used. So any files missing you can get from that directory. – Sean Faria Oct 21 '22 at 16:16
2

I solved this by first upgrading amplify by amplify upgrade , then deleted amplify folder at the root folder of the project, and then pulled the amplify project by specifying appId and envName like following amplify pull --appId xyz --envName dev At the console some questions will appear and the important one ise 'Do you plan on modifying this backend?' , I chose Yes. And finally backend folder is added.

oktemerbay
  • 61
  • 5
1

I've solved the issue after more than 24 hours of frustration looking for the solution. In my C:\Users\BEN.amplify\bin I deleted the bin folder, and I upgraded the amplify CLI using:- "curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd" After the download and installation I restarted my system. That solved the backend-config.json does not exist issue.

I hope this works for you if you have this same issue.

Benjamin Ikwuagwu
  • 377
  • 1
  • 9
  • 28
0
backend:
  phases:
   build:
      commands:
        - amplifyPush --simple
        - mv ./amplify/\#current-cloud-backend/backend-config.json ./