amplify-cli: Installed amplify-cli and got this error: ENOENT: no such file or directory, ...team-provider-info.json'

@UnleashedMind I have just moved to a new machine and my project was running beautifully on the new machiine(with Api, Auth, Storage services via Amplify). I realised i needed to interact with amplify-cli, so I then installed npm install -g @aws-amplify/cli. I ran amplify status:

| Category | Resource name | Operation | Provider plugin   |
| -------- | ------------- | --------- | ----------------- |
| Api      | project     | Update    | awscloudformation | <-strangely updated?
| Auth     | project837477  | No Change | awscloudformation |
| Storage  | projectStorage | No Change | awscloudformation |

Strangely Api updated even though i’ve made no changes. Anyway, when i ran amplify push, i got the following error. An error occurred during the push operation: ENOENT: no such file or directory, team-provider-info.json'. This file exists, just as it did in my project folder on my last machine.

Then i tried npm install -g @aws-amplify/cli@4.11.0 but still no luck to push. What on earth is going on? I’m paralyzed in my tracks right now and i have to kick on and complete this project. Please help!!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28 (9 by maintainers)

Most upvoted comments

Spent quite some time and I figured out where it is. There is a file called local-env-info.json where the path to the project is configured. This is the file which needs to be updated when the path of the repo change. Now amplify push / publish works again image

@chai86 Just try running amplify configure project. I believe the “projectPath” for your new machine would be different than your previous machine right? amplify configure project should be able to rectify that.

So the problem in my case it was I stoped the process in the middle causing a crash in amplify I deleted everything inside of /home/whatever/.nvm/versions/node/v12.18.4/lib/node_modules/@aws-amplify/ and reinstalled amplify, that worked

I just ran into a similar issue. I’m curious, in the path does it reference amplify twice?

e.g. /amplify/amplify/team-provider-info.json?

This is the problem for me, were you able to solve?

There’s no need to create restore point, when you clone your project to another dev machine, you just need to make sure that the new machine has the proper aws configuration files under ~/.aws, and then run amplify pull and amplify init in sequence to setup your local development environments.

@chai86 Just try running amplify configure project. I believe the “projectPath” for your new machine would be different than your previous machine right? amplify configure project should be able to rectify that.

@kaustavghosh06 I changed my “projectPath” to the one i was using before, but now when i run amplify push i get the error:

✖ There was an error pulling the backend environment dev.
An error occured during the push operation: ENOENT: no such file or directory, open '/Users/username/.aws/credentials

When i run amplify configure project it’s like doing an amplify init and building a project from scratch. I’m being asked:

? Enter a name for the project: ProjectName
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using (Use arrow keys)
  angular 
  ember 
  ionic 
  react 
❯ react-native 
  vue 
  none 
etc....

I also already have a region, username and accessKey, secretAccess key etc…

I do not want to replace or ruin anything in my current backend or current project! Should i continue this process/amplify pull?